add dup __proto__ in json test

This commit is contained in:
Gus Caplan 2020-10-01 17:02:15 -05:00 committed by Rick Waldron
parent 6aa8338d23
commit ef1ad4c041
1 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,17 @@
// Copyright (C) 2020 devsnek. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-object-initializer-static-semantics-early-errors
description: >
It is a Syntax Error if PropertyNameList of PropertyDefinitionList contains
any duplicate entries for "__proto__" and at least two of those entries were
obtained from productions of the form
PropertyDefinition : PropertyName `:` AssignmentExpression .
This rule is not applied if this PropertyDefinition is contained within a
Script which is being evaluated for JSON.parse (see step 4 of JSON.parse).
---*/
var result = JSON.parse('{ "__proto__": 1, "__proto__": 2 }');
assert.sameValue(result.__proto__, 2);