A DOM use case that can't be emulated with direct proxies
Mark S. Miller
erights at google.com
Thu Dec 13 19:34:33 PST 2012
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
* 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, where the getter stays the same and the magic
"switching" behavior is in the getter. (My words for Allen's
Either is fine. I like Allen's better.
More information about the es-discuss