W3C home > Mailing lists > Public > public-script-coord@w3.org > October to December 2013

Re: Figuring out easier readonly interfaces

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Wed, 02 Oct 2013 17:36:00 -0400
Message-ID: <524C91C0.70304@mit.edu>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
CC: "public-script-coord@w3.org" <public-script-coord@w3.org>
On 10/2/13 5:31 PM, Tab Atkins Jr. wrote:
> And, regardless of what that method does, if it tries to mutate the
> proxy, it'll run into one of the intercepted traps.

No.  What that method does for, say, a getter is extract the underlying 
object that actually has the state (the C++ object in the case of Gecko 
and Blink and WebKit, for example) and modify _that_.

Let's do a concrete example to illustrate.

Say you had a readonly<Node> and you got the "id" setter off 
Element.prototype and called it.  What would happen, and why?

-Boris
Received on Wednesday, 2 October 2013 21:36:29 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:18 UTC