Sam Tobin-Hochstadt (2013-07-11T01:06:40.000Z)
domenic at domenicdenicola.com (2013-07-13T01:09:14.653Z)
On Wed, Jul 10, 2013 at 8:02 PM, Allen Wirfs-Brock <allen at wirfs-brock.com> wrote: >> But this is incorrect, because modules check that their bodies don't >> have free variables, so the above code has a _static_ error. > > Ah, do you mean this is a link time check? > > It isn't a regular early error situations because gvar could be a dynamically added property on the global object. > > Not sure what your current semantics are, but I thought it was established a long time ago that modules needed free references in order to deal with global object properties. No, that's not what I mean. The semantics we've discussed multiple times are that modules are compiled with respect to the global object at compilation time, and free variables at that point (ie, compilation time) are a static error. This is implicit in the discussion here: http://wiki.ecmascript.org/doku.php?id=harmony:module_loaders (see the "global objects" section) and explicit in some of the notes, I'm sure.