On Oct 28, 2014 9:10 AM, Andreas Rossberg <[email protected]> wrote: > > While polishing some remaining corners of lexical scoping support in > V8, we stumbled over the following. > > ES5 has the invariant that any identifier not found on the scope chain > _has to be_ a property of the global object (except in the presence of > 'with' or sloppy direct eval), or be a reference error. In particular, > this guarantees that the compiler usually knows that 'undefined' is > bound to the undefined value, and similarly for other frozen > properties of the global object. > > In ES6, this no longer seems to be the case, due to the mutable > toplevel lexical scope. At least I wasn't able to find language in the > draft that would make the following example illegal: > > <> > function f(x) { return x === undefined } > </> > > <> > let undefined = 666 > f() // false > </> > > Is that correct? > > (I would have expected the VarNames list of the initial global > environment to contain all global names from Sec. 18, but that doesn't > seem to be the case.)
This sounds like an oversight on my part. Please file a bug and I'll fix it. However, that won't do any thing for host defined global properties Allen _______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

