On Oct 29, 2014, at 6:54 AM, Anne van Kesteren <[email protected]> wrote:

> On Wed, Oct 29, 2014 at 1:53 AM, Allen Wirfs-Brock
> <[email protected]> wrote:
>> I suppose we could extend that to include all built-in globals.  Could 
>> really do it for host defined globals.
> 
> 1) I thought the idea was that "host defined" would be a thing of the
> past. Do we want differences in capabilities between globals defined
> through JavaScript libraries and the browser?

The issues is really about the difference between globals that are explicitly 
declared in ES using var (or function) and properties of the global object that 
have been directly created via direct property access. Historically, ES defined 
globals and platform defined globals were treated as pre-existing properties.

ES since forever have made special provisions about when shadowing of such 
properties are allowed.  Both global var and function declarations reused any 
global object existing property for the declared name, except that function 
declarations refused to change the value of non-configurable readonly 
properties.

Note that global object properties that are not declared bindings can be 
created by ES code, too.

If browsers use the same semantic mechanisms a libraries (or the implementation 
level equivalent) then they will behave identically.

> 
> 2) While document, navigator, etc. are non-configurable and whatnot,
> there's a bunch of other "host defined" globals that have different
> characteristics. Just study Window's IDL in HTML.
> 

Yes, has always been the case and ES has allowed them to be over-written by 
explicit var and function declarations, except as noted above.

What we are really talking about here is whether let-style declarations should 
be able to over-write such properties.

Allen



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

Reply via email to