Sam Tobin-Hochstadt (2013-07-11T14:55:57.000Z)
On Thu, Jul 11, 2013 at 8:24 AM, Kevin Smith <zenparsing at gmail.com> wrote:
>
>>
>> Why allow global scope to leak into a new module?
>
> That would require a tedious preamble for pretty much any bit of code you
> want to write.

We agree, that's why we haven't tried to do this.

> How about performing free variable checking as late as possible (i.e. just
> before the module body executes), giving module dependencies a chance to
> polyfill the global object if they so choose?

This is the other major option -- it delays errors, potentially to
much later, which can be painful when it happens too late to catch.
That's why we haven't gone with it currently.

Sam
domenic at domenicdenicola.com (2013-07-13T01:12:44.914Z)
On Thu, Jul 11, 2013 at 8:24 AM, Kevin Smith <zenparsing at gmail.com> wrote:
>> Why allow global scope to leak into a new module?
>
> That would require a tedious preamble for pretty much any bit of code you
> want to write.

We agree, that's why we haven't tried to do this.

> How about performing free variable checking as late as possible (i.e. just
> before the module body executes), giving module dependencies a chance to
> polyfill the global object if they so choose?

This is the other major option -- it delays errors, potentially to
much later, which can be painful when it happens too late to catch.
That's why we haven't gone with it currently.