A DOM use case that can't be emulated with direct proxies

Brendan Eich brendan at mozilla.com
Thu Dec 13 23:25:24 PST 2012


Mark S. Miller wrote:
> On Thu, Dec 13, 2012 at 7:05 PM, Brendan Eich<brendan at secure.meer.net>  wrote: 
>
>> Boris Zbarsky pointed out on public-script-coord that window.location and 
>>
>> window.document must be non-configurable _ab initio_, but perhaps this is 
>>
>> achievable with direct proxies?
>
> This resolved into two suggestions, both consistent with ES5 and with
> direct proxies:
>
> * windows.document and window.location must refuse to be configured,
> but they can still claim to be configurable. ES5 purposely forbids
> only the opposite mismatch: They can't claim to be non-configurable
> but still change state in ways that violate that claim.
>
> * Allen suggested that these could be non-configurable getter-only
> accessor properties,

window.location can be set by assignment to navigate to a new URL. Yet 
it appears in Chrome, Firefox, Opera, and Safari to be a writable data 
property. In any event, it can't be a getter-only accessor.

/be

>   where the getter stays the same and the magic
> "switching" behavior is in the getter. (My words for Allen's
> suggestion)
>
> Either is fine. I like Allen's better.
>
> -- 
>      Cheers,
>      --MarkM
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>


More information about the es-discuss mailing list