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

Tom Van Cutsem tomvc.be at gmail.com
Tue Dec 18 13:39:51 PST 2012


2012/12/14 Mark S. Miller <erights at google.com>

> On Fri, Dec 14, 2012 at 10:19 AM, Brendan Eich <brendan at mozilla.com>
> wrote:
> > David Bruant wrote:
> >> Le 14/12/2012 08:25, Brendan Eich a écrit :
> >>> window.location can be set by assignment to navigate to a new URL.
> >>
> >> location is [Unforgeable, PutForward], so it should be reflected as a
> >> non-configurable getter+setter according to WebIDL.
> [...]
> > Nevertheless, since ES5-standard reflection is new, I doubt anyone cares
> > that location appears to be a data property. It should be an accessor.
> But
> > it needs to be non-configurable, so we still have a problem -- or do we?
>
> AFAICT, a non-configurable accessor fits all the constraints.


Also, when emulating this property using a proxy, reflecting it as a
non-configurable accessor will not violate any proxy invariants, so this is
good.

However, regarding the retargetable proxy pattern put forward by Kevin and
Jason to emulate WindowProxy, that implementation cannot accurately expose
window.location as non-configurable, but would need to expose it as
configurable instead.

Cheers,
Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121218/ecf8047c/attachment.html>


More information about the es-discuss mailing list