Debian Codegraph @

js/src/tests/non262/JSON/parse-with-source-proto.js

raw
1 // |reftest| shell-option(--enable-json-parse-with-source) skip-if(!JSON.hasOwnProperty('isRawJSON')||!xulRuntime.shell)
2
3 // Changing Object.prototype should not change the behavior of JSON parsing.
4 Object.defineProperty(Object.prototype, 1, {
5 set(val) {
6 this[0] = {}
7 },
8 })
9 assertDeepEq(["a", "b"], JSON.parse('["a","b"]', (k,v,c) => v))
10
11 if (typeof reportCompare == 'function')
12 reportCompare(0, 0);