Four static scoping violations in ES5 sloppy

Brendan Eich brendan at mozilla.com
Mon Mar 18 10:17:20 PDT 2013


Andreas Rossberg wrote:
> On 18 March 2013 17:48, Brendan Eich<brendan at mozilla.com>  wrote:
>> Andreas Rossberg wrote:
>>> Maybe I misunderstand what you mean, but unfortunately, the global
>>> object will remain at the top of the scope chain in ES6, even with
>>> modules (though complemented with a lexical environment for new
>>> binding forms). We shied away from fixing that mistake.
>> Don't break the web.
>>
>> Versioning is an anti-pattern.
>>
>> I don't think "shied away" is accurate. We couldn't fix that mistake.
>
> I think we could have fixed it for modules. Whether that would have
> been worth it I don't know.

For modules with the standard loader, it would be not web-breaking but 
pretty code-migration-hostile to remove the global.

With a custom loader, sure. Possibly this can be made into a one-liner.

/be


More information about the es-discuss mailing list