Andreas Rossberg <mailto:[email protected]>
January 24, 2012 10:32 AM

Taken literally, an implicit block scope at toplevel would imply that
let/const-bound properties won't show up on the global object at all.
That seems to devalue the global object and/or let.

I prefer to think of it as saving 'let' from the degradations of the global object ;-).

I am skeptical we will banish var, ever. Consider the object detection pattern:

  if (!this.foo) {
    var foo = function () {
      ...
    };
  }

No way to make this work with let.

(Part of) what I proposed in the OP of this thread is that for the
toplevel, we can still safely reflect let/const bindings on the global
object, but through accessor properties -- just like with module
instance objects. Solves all the problems we just discussed, while
also keeping let useful as the new var.

I saw, clever approach -- haven't had time to evaluate it for compatibility. Seems optimizable.

/be

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to