B.3.1 The __proto__ pseudo property

Olov Lassus olov.lassus at gmail.com
Sun Apr 21 13:58:34 PDT 2013


2013/4/21 Allen Wirfs-Brock <allen at wirfs-brock.com>
>  Also note that JSON.parse('{"__proto__": null}') does not create an object whose [[Protoype]] is null because JSON.parse uses [[DefineOwnProperty]] to create all its properties so this will just result in an own property whose value is null.

Side-tracking the discussion but perhaps someone will find it interesting:
That varies with JS implementations. v8 as of Chrome and Node stable
sets [[Prototype]] so you can cause all kinds of crazy things
happening by doing a JSON.parse('{"__proto__": null}'),
JSON.parse('{"__proto__": []}') or why not a JSON.parse('{"__proto__":
{"sessionid": "cantbedeleted"}}'). v8 bleeding edge and Chrome Canary
has fixed this. https://code.google.com/p/v8/issues/detail?id=621 for
more info.

/Olov


More information about the es-discuss mailing list