- 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
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