On Wed, May 30, 2012 at 7:12 AM, Felix Böhm <[email protected]> wrote:
> > > 2012/5/30 Brendan Eich <[email protected]> > >> Felix Böhm wrote: >> >>> Okay, fair point. But JSON.parse should do what it's name says: Parse >>> JSON. Ignoring keys is not an option. >>> >> JSON.parse must not treat __proto__ specially, per ES5. What's the >> problem you see? > > > As written before, V8 ignores keys named __proto__ in JSON.parse (I > haven't tested other engines yet). I was concerned that this behavior would > become the default. > These are filed and accepted bugs in v8: http://code.google.com/p/v8/issues/detail?id=621 http://code.google.com/p/v8/issues/detail?id=1310 and tested by test262: http://hg.ecmascript.org/tests/test262/file/c84161250e66/test/suite/ch15/15.12/15.12.2/S15.12.2_A1.js > >> >> Having __proto__ as a setter would make much more sense for me, too. No >>> magic involved, just some functionality I don't need to care about. >>> >> >> Please see the thread on "Re: Subclassing built-in constructors", also >> the meeting notes followups from me. __proto__ has a hidden setter, it >> masquerades as a data property to avoid leaking a set-[[Prototype]] >> capability that would require extra checking and could (based on long and >> hard experience) lead to mischief. >> >> The de-facto and soon to be de-jure Object.prototype.__proto__ standard >> has no bearing on ES5's JSON.parse, which continues unchanged per the JSON >> RFC (I trust -- tell me if you see a bug). >> >> /be >> > > > _______________________________________________ > es-discuss mailing list > [email protected] > https://mail.mozilla.org/listinfo/es-discuss > > -- Cheers, --MarkM
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

