W3C home > Mailing lists > Public > public-script-coord@w3.org > April to June 2011

Re: [WebIDL] Indexed properties and [[Extensible]]

From: Cameron McCormack <cam@mcc.id.au>
Date: Thu, 26 May 2011 12:52:57 +1200
To: Jonas Sicking <jonas@sicking.cc>
Cc: David Flanagan <dflanagan@mozilla.com>, public-script-coord@w3.org
Message-ID: <20110526005257.GD22372@wok.mcc.id.au>
Jonas Sicking:
> How do named/indexed getters/setters interact with the prototype
> chain? Are they supposed to show up as properties on the object
> itself, or should they show up as "catch all" getters on an object on
> the proto chain?

They are currently required to show up as properties on the object
itself.  After http://www.w3.org/mid/20110503052431.GN2576@wok.mcc.id.au
it seems like the spec should switch back to specifying [[Get]],
[[Put]], etc. to make them catch-alls.  As I said in the thread, I think
it’s a cleaner / easier model to think about.

> The latter is how we implement them in Firefox. The former might be
> more javascripty since it doesn't require catch-alls.
> 
> If it's the latter, then this isn't a problem at all since when you
> freeze, you only freeze the object itself. Objects on the prototype
> chain aren't affected at all.

You’re arguing that since the catch-alls are already a layer on top of
the existing object, that we could make freeze() etc. succeed but have
that catch-all layer ignore it, just as it ignores whatever properties
are on the object underneath when it goes to create a new named
property?  I think the only problem with this is that the proxy trap to
fix an object with freeze, seal or preventExtensions must return a
static description of an object that the proxy “becomes”, so it wouldn’t
be possible to make, say, preventExtensions() cause existing named
properties continue to be live while new ones cannot be created.  As far
as I understand the proxy proposal.

-- 
Cameron McCormack ≝ http://mcc.id.au/
Received on Thursday, 26 May 2011 00:53:29 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:03 UTC