>
> Note that there are situations where you can still get a
> ReferenceError inside a module, by deleting properties off of
> `window`. Ruling this out would require:
>
> 1. not giving modules access to the global scope, or
> 2. changing the global object when compiling modules
>
> Neither of these seem like good ideas.
>
>
I agree. I wonder, though, why my previous example should work, but this
should fail:
// Before linking, window.bar is not defined
// foo.js
window.bar = "bar";
// main.js
import "foo";
console.log(bar); // Link time error
But if we ran "foo" in a previous linking/execution pass, then it would
work.
Since this is a departure from the current non-module handling of global
object variable references, what is the motivation?
{ Kevin }
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss