On 30 June 2012 22:38, John J Barton <[email protected]> wrote:

> As Dave suggests, my gut feeling is that we don't want
>     // main.js
>     import g from "./legacy.js";
> to mean "legacy.js" can be ES6 or not. It's ES6 or it's an error.
>
> However, let's consider your proposal anyway. Let's read main.js and parse
> it.
>     // main.js
>     import g from "./legacy.js";
> Now we know we need legacy.js, so we fetch it and parse it. Does it form
> an ES6 module? Go with it. No? Ok fallback and execute it
> using compatibility rules. This could include looking for clues that tell
> us this is an AMD or node file. We know this mode is a hack, we only need
> it to be good enough to push modules over the hump.
>

Almost any old JS file (except for one containing 'with' I think) forms a
legal ES6 module body -- it's just not going to export anything.

So as Dave said, you'd probably need an explicit import-side distinction to
differentiate.

/Andreas
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to