On __proto__ as a magical data property
rossberg at google.com
Thu Jul 19 02:56:14 PDT 2012
On 19 July 2012 00:19, Jason Orendorff <jason.orendorff at gmail.com> wrote:
> On Wed, Jul 18, 2012 at 3:31 PM, Brendan Eich <brendan at mozilla.org> wrote:
> > In particular, we don't want a proto-chain walk from [[CanPut]] and a
> > walk from the "has" under the __proto__ setter for
> > obj.__proto__ = safe; // not in SES code
> > just because we might need the "has" for
> > evil = Object.getOwnPropertyDescriptor(Object.prototype,
> > // later ...
> > evil.call(victim, unsafe);
> > How would you spec this?
> I would spec the desired semantics. I really don't think we should
> bend the language spec an iota around performance here.
I like Jason's suggestion, and I agree that performance should be the least
of all concerns for proto mutation.
(In fact, can we perhaps spec it in a way that guarantees that this
operation is so expensive that it discourages everybody from still using it
in the future? Like, insert a step that says "pause for 10 seconds to
reconsider". :) )
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss