W3C home > Mailing lists > Public > public-script-coord@w3.org > January to March 2015

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

From: Domenic Denicola <d@domenic.me>
Date: Wed, 28 Jan 2015 16:51:43 +0000
To: "Mark S. Miller" <erights@google.com>, Boris Zbarsky <bzbarsky@mit.edu>
CC: es-discuss <es-discuss@mozilla.org>, "public-script-coord@w3.org" <public-script-coord@w3.org>, Domenic Denicola <domenic@domenicdenicola.com>
Message-ID: <CY1PR0501MB136921F59E3608409803B9A4DF330@CY1PR0501MB1369.namprd05.prod.outlook.com>
From: Mark S. Miller [mailto:erights@google.com] 

> On Tue, Jan 27, 2015 at 5:53 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
>> I'd like to understand better the suggestion here, because I'm not sure I'm entirely following it.  Specifically, I'd like to understand it in terms of the internal methods defined by <https://github.com/domenic/window-proxy-spec>.
>>
>> Presumably you're proposing that we keep all of that as-is except for [[DefineOwnProperty]], right?
>>
>> For [[DefineOwnProperty]], are we basically talking about changing step 1 to:
>>
>> 1)  If the [[Configurable]] field of Desc is present and Desc.[[Configurable]] is false, then throw a TypeError exception.
>>
>> while keeping everything else as-is,
>
> Exactly correct. I didn't realize until reading your reply is that this is all that's necessary -- that it successfully covers all the cases I was thinking about without any further case division.

I'm having a bit of trouble understanding how this maps to the solution described in your previous message, Mark. Your "I didn't realize until reading your reply is that this is all that's necessary" indicates I'm probably just missing something, so help appreciated.

My question is, what happens if Desc.[[Configurable]] is not present, and P does not already exist on W? By my reading, we then fall through to calling the [[DefineOwnProperty]] internal method of W with arguments P and Desc.

Assuming W's [[DefineOwnProperty]] is that of an ordinary object, I believe that takes us through OrdinaryDefineOwnProperty(W, P, Desc). Since P does not exist on W, and W is extensible, that takes us to ValidateAndApplyPropertyDescriptor(O, P, true, Desc, undefined). Then according to step 2.c, " If the value of an attribute field of Desc is absent, the attribute of the newly created property is set to its default value." The default value is false, right? So won't this try to define a non-configurable property on W?

I would have thought the modification needed to be more like:

[[DefineOwnProperty]] (P, Desc)

1. If desc.[[Configurable]] is not present, set desc.[[Configurable]] to true.
2. If desc.[[Configurable]] is false, then throw a TypeError exception.
3. Return the result of calling the [[DefineOwnProperty]] internal method of W with arguments P and Desc.

(here I have inserted step 1, but step 2 and 3 are unchanged from the previous incarnation).
Received on Wednesday, 28 January 2015 16:52:27 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 28 January 2015 16:52:28 UTC