diff options
Diffstat (limited to 'website/resources/scripts/testcases2/15.12.2_JSON.parse.json')
-rw-r--r-- | website/resources/scripts/testcases2/15.12.2_JSON.parse.json | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/website/resources/scripts/testcases2/15.12.2_JSON.parse.json b/website/resources/scripts/testcases2/15.12.2_JSON.parse.json new file mode 100644 index 000000000..33253ab7f --- /dev/null +++ b/website/resources/scripts/testcases2/15.12.2_JSON.parse.json @@ -0,0 +1,14 @@ +{ + "testCollection": { + "name": "15.12.2_JSON.parse", + "numTests": 1, + "tests": [ + { + "section": "15.12.2", + "description": "Tests that JSON.parse treats \"__proto__\" as a regular property name", + "test": "var x = JSON.parse('{\"__proto__\":[]}');\nif (Object.getPrototypeOf(x) !== Object.prototype) {\n $FAIL('#1: JSON.parse confused by \"__proto__\"');\n}\nif (!Array.isArray(x.__proto__)) {\n $FAIL('#2: JSON.parse did not set \"__proto__\" as a regular property');\n}\n", + "id": "S15.12.2_A1" + } + ] + } +} |