Re: Figuring out the behavior of WindowProxy in the face of non-configurable properties

On 12/2/14, 4:59 AM, Andreas Rossberg wrote:
> On 1 December 2014 at 03:12, Mark S. Miller <erights@google.com> wrote:
>> On Sun, Nov 30, 2014 at 12:21 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
>>> Per spec ES6, it seems to me like attempting to define a non-configurable
>>> property on a WindowProxy should throw and getting a property descriptor for
>>> a non-configurable property that got defined on the Window (e.g. via "var")
>>> should report it as configurable.
>
> Can you clarify? Do you mean that it should report properties as
> configurable, but still reject attempts to actually reconfigure them?

Yes, correct.

> Also, how would you allow 'var' to even define non-configurable
> properties?

Because "var" operates on the global directly.  The global is a Window, 
not a WindowProxy and has no magic behavior.

> If you want DefineProperty to throw on any such attempt,
> then 'var' semantics would somehow have to bypass the MOP.

The idea is that WindowProxy's [[DefineOwnProperty]] would throw as 
needed.  Window's [[DefineOwnProperty]] is just 
http://people.mozilla.org/~jorendorff/es6-draft.html#sec-ordinarydefineownproperty

-Boris

Received on Tuesday, 2 December 2014 15:36:51 UTC