Function identity of non-configurable accessors

2012-12-15 Thread David Bruant
Hi, ES5 invariants are silent when it comes to function identity of non-configurable accessors. That is, for a given object o, Object.getOwnPropertyDescriptor(o, 'a').get === Object.getOwnPropertyDescriptor(o, 'a').get (two seperate calls) is not guaranteed. The built-in

Re: Function identity of non-configurable accessors

2012-12-15 Thread Sam Tobin-Hochstadt
On Sat, Dec 15, 2012 at 9:27 AM, David Bruant bruan...@gmail.com wrote: The way things are going, WindowProxy [Unforgeable] properties will be non-configurable getters. If, upon underlying window change, the WindowProxy is expected to keep the exact same getter function, then, it may result in

Re: Function identity of non-configurable accessors

2012-12-15 Thread David Bruant
Le 15/12/2012 15:49, Sam Tobin-Hochstadt a écrit : On Sat, Dec 15, 2012 at 9:27 AM, David Bruant bruan...@gmail.com wrote: The way things are going, WindowProxy [Unforgeable] properties will be non-configurable getters. If, upon underlying window change, the WindowProxy is expected to keep the

Reflection of global bindings

2012-12-15 Thread David Bruant
Hi, On public-script-coord, Boris Zbarsky showed an example [1] where a global variable is var-defined and then observed to be absent from the global object it was attached to (because the WindowProxy has changed of underlying window object). The careful ECMAScript 5.1 reader knows that

Re: Reflection of global bindings

2012-12-15 Thread Boris Zbarsky
On 12/15/12 12:21 PM, David Bruant wrote: On public-script-coord, Boris Zbarsky showed an example [1] where a global variable is var-defined and then observed to be absent from the global object it was attached to (because the WindowProxy has changed of underlying window object). No, nothing

Re: Reflection of global bindings

2012-12-15 Thread Brandon Benvie
The need to do what was proposed is the same though. Configurability can be arm twisted into submission for things like document and location via accessors, and the WindowProxy can refuse to accept non-configurable properties defined using Object.defineProperty, but that leaves non-configurable

Re: Reflection of global bindings

2012-12-15 Thread David Bruant
Le 15/12/2012 18:23, Boris Zbarsky a écrit : On 12/15/12 12:21 PM, David Bruant wrote: On public-script-coord, Boris Zbarsky showed an example [1] where a global variable is var-defined and then observed to be absent from the global object it was attached to (because the WindowProxy has changed

Re: Reflection of global bindings

2012-12-15 Thread Boris Zbarsky
On 12/15/12 12:34 PM, David Bruant wrote: No, nothing of the sort. The example shows it _present_ on the global (the third alert in my example) but missing from the WindowProxy (fourth alert). I'm comparing the second and fourth alert (that's not what the example was created to show, but

Re: Reflection of global bindings

2012-12-15 Thread David Bruant
Le 15/12/2012 18:37, Boris Zbarsky a écrit : On 12/15/12 12:34 PM, David Bruant wrote: No, nothing of the sort. The example shows it _present_ on the global (the third alert in my example) but missing from the WindowProxy (fourth alert). I'm comparing the second and fourth alert (that's not

Re: Reflection of global bindings

2012-12-15 Thread Boris Zbarsky
On 12/15/12 12:48 PM, David Bruant wrote: Sure, but those aren't properties on the _global_. They're properties on a different object. Script authors can't observe the fact that it's a different object. Yes, they can. The third and fourth alerts in my testcase constitute just such an

Re: Function identity of non-configurable accessors

2012-12-15 Thread Brendan Eich
David Bruant wrote: If I create a non-configurable property with a getter that I define (such as `() = 3`), I know that accessing the property will always produce a known value.Relaxing this restriction means that proxies could produce whatever they wanted in this situation. Indeed. Note

Re: Reflection of global bindings

2012-12-15 Thread Allen Wirfs-Brock
On Dec 15, 2012, at 9:21 AM, David Bruant wrote: Hi, On public-script-coord, Boris Zbarsky showed an example [1] where a global variable is var-defined and then observed to be absent from the global object it was attached to (because the WindowProxy has changed of underlying window

Re: Reflection of global bindings

2012-12-15 Thread Brendan Eich
Allen Wirfs-Brock wrote: On Dec 15, 2012, at 9:21 AM, David Bruant wrote: Hi, On public-script-coord, Boris Zbarsky showed an example [1] where a global variable is var-defined and then observed to be absent from the global object it was attached to (because the WindowProxy has changed of

RE: Reflection of global bindings

2012-12-15 Thread Domenic Denicola
From: es-discuss-boun...@mozilla.org [mailto:es-discuss-boun...@mozilla.org] 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

Re: Reflection of global bindings

2012-12-15 Thread Brendan Eich
Domenic Denicola wrote: From: es-discuss-boun...@mozilla.org [mailto:es-discuss-boun...@mozilla.org] 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

Re: Reflection of global bindings

2012-12-15 Thread David Bruant
Le 15/12/2012 19:38, Allen Wirfs-Brock a écrit : On Dec 15, 2012, at 9:21 AM, David Bruant wrote: Hi, On public-script-coord, Boris Zbarsky showed an example [1] where a global variable is var-defined and then observed to be absent from the global object it was attached to (because the

Re: Function identity of non-configurable accessors

2012-12-15 Thread David Bruant
Le 15/12/2012 19:11, Brendan Eich a écrit : David Bruant wrote: If I create a non-configurable property with a getter that I define (such as `() = 3`), I know that accessing the property will always produce a known value.Relaxing this restriction means that proxies could produce whatever

Re: Function identity of non-configurable accessors

2012-12-15 Thread Brendan Eich
David Bruant wrote: Le 15/12/2012 19:11, Brendan Eich a écrit : David Bruant wrote: If I create a non-configurable property with a getter that I define (such as `() = 3`), I know that accessing the property will always produce a known value.Relaxing this restriction means that proxies

Re: Function identity of non-configurable accessors

2012-12-15 Thread Brandon Benvie
Is there any leak if you set the accessor functions to have a null [[Prototype]] and to have no non-primitive properties? On Sat, Dec 15, 2012 at 4:20 PM, Brendan Eich bren...@mozilla.com wrote: David Bruant wrote: Le 15/12/2012 19:11, Brendan Eich a écrit : David Bruant wrote: If I

Re: Reflection of global bindings

2012-12-15 Thread Allen Wirfs-Brock
On Dec 15, 2012, at 12:12 PM, Brendan Eich wrote: Domenic Denicola wrote: From: es-discuss-boun...@mozilla.org [mailto:es-discuss-boun...@mozilla.org] On Behalf Of Brendan Eich Sent: Saturday, December 15, 2012 14:26 Reflecting var and function bindings on window (or |this| or |self|

Re: Function identity of non-configurable accessors

2012-12-15 Thread David Bruant
Le 15/12/2012 22:20, Brendan Eich a écrit : David Bruant wrote: Le 15/12/2012 19:11, Brendan Eich a écrit : Frozen accessors would be best if we can get away with the incompatibility. I've given more thought. Frozen accessors can't be a solution. Only deeply frozen would be. Oh sure -- that

Re: Function identity of non-configurable accessors

2012-12-15 Thread David Bruant
Le 15/12/2012 22:26, Brandon Benvie a écrit : Is there any leak if you set the accessor functions to have a null [[Prototype]] and to have no non-primitive properties? There isn't. That would be the super-minimal null realm solution. David On Sat, Dec 15, 2012 at 4:20 PM, Brendan Eich

Re: Function identity of non-configurable accessors

2012-12-15 Thread David Bruant
Le 15/12/2012 16:14, David Bruant a écrit : Le 15/12/2012 15:49, Sam Tobin-Hochstadt a écrit : If I create a non-configurable property with a getter that I define (such as `() = 3`), I know that accessing the property will always produce a known value.Relaxing this restriction means that