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

Re: Figuring out easier readonly interfaces

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Wed, 2 Oct 2013 14:25:10 -0700
Message-ID: <CAAWBYDCn4uWxcLP3Q6V4ZOMtVmZg=e04_SoZ6m--MO4MXFtVVQ@mail.gmail.com>
To: Boris Zbarsky <bzbarsky@mit.edu>
Cc: "public-script-coord@w3.org" <public-script-coord@w3.org>
On Wed, Oct 2, 2013 at 2:17 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> On 10/2/13 5:10 PM, Tab Atkins Jr. wrote:
>> From what I can tell, the easiest way to do this is to use a Proxy
>> around the mutable instance, which intercepts the "set" and
>> "deleteProperty" traps (and maybe "defineProperty"?) and cancels them,
>> and forwards the rest of the traps.
>
> So directly .apply()-ing a setter gotten off the prototype would still
> mutate the object?

I don't think so, but I could be wrong.  I think that still ends up
trying to do a "set" on the proxy, which'll get intercepted and
cancelled.  It just takes a more circuitous route to get there.

(I can't find the Proxy definitions in the latest HTML version of the
ES spec, so I'm going on the most recent wiki page defining this stuff
for now.  Publishing specs as Word documents continues to be
ridiculous.)

~TJ
Received on Wednesday, 2 October 2013 21:25:56 UTC

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