Reflection of global bindings

Brendan Eich brendan at
Sat Dec 15 12:12:36 PST 2012

Domenic Denicola wrote:
>> From: es-discuss-bounces at [mailto:es-discuss-bounces at] On Behalf Of Brendan Eich
>> Sent: Saturday, December 15, 2012 14:26
>> Reflecting var and function bindings on window (or |this| or |self| or other aliases) as configurable properties, but refusing to allow reconfiguration, is a solution, however distasteful. Allowing configuration is no good, of course.
> As someone who's trying desperately to follow along with all these subtle issues from the sidelines... Why is allowing configuration of such properties no good?

Becausethe only integrity guarantee in JS prior to ES5 was via var and 
function making non-configurable bindings. This is used especially in 
closures, e.g. You can't delete a var- or function-induced binding not 
created from eval. But it is also used at the top-level, not only by 
code but also by VMs that can optimize accordingly (no delete, the 
"slot" can't change).

It may seem silly to reflect the global bindings as configurable but 
refuse configuration attempts, but that satisfies the invariant at 
stake. Reflecting the function and var bindings non-configurable but 
allowing apparent reconfiguration via WindowProxy-forwarded navigation 
breaks the invariant.


More information about the es-discuss mailing list