Closed
Description
The json5-spec didn't mention it.
JSON5.parse('{__proto__:1}').__proto__ // not 1
I know it's in js-spec, I just wonder whether it should be same like js.
({__proto__:1}).__proto__ // not 1
Because in JSON land, __proto__
key is just a normal key, as a data language.
JSON.parse('{"__proto__":1}').__proto__ // is 1
BTW: Is it right for JSON5 parser use [[set]]
not [[define]]
?
Object.defineProperty(Object.prototype, 'xxx', { set (value) { console.log('setting!'); } });
JSON5.parse('{xxx:1}');// setting!