Re: cgjs VS cgj + esm progress
- From: Andrea Giammarchi <andrea giammarchi gmail com>
- To: Philip Chimento <philip chimento gmail com>
- Cc: javascript-list <javascript-list gnome org>
- Subject: Re: cgjs VS cgj + esm progress
- Date: Sun, 4 Feb 2018 10:48:40 +0100
Hi Philip,
SpiderMonkey already supports ESM indeed, you just need to start the project with a `-m` or `--module=PATH` flag.
If GJS would be so kind to pass along such flag when used, developers could arbitrary decide to start GJS as module or not.
Test case
a.js
```
import {cwd} from './b.js';
print(cwd());
```
b.js
```
const GLib = imports.gi.GLib;
export const cwd = () => GLib.get_current_dir();
```
gjs -m a.js
should not produce syntax error, should pass -m flag along and let SpiderMonkey handle the ESM module system.
Where should I look to pass along flags ?
Thanks!
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]