mirror of
https://github.com/tc39/test262.git
synced 2025-07-26 15:34:29 +02:00
Add permitted duplicate test for shorthand properties
This commit is contained in:
parent
4d4c160674
commit
c558dad25f
@ -0,0 +1,25 @@
|
|||||||
|
// Copyright (C) 2020 Alexey Shvayka. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
esid: sec-object-initializer
|
||||||
|
description: Permitted duplicate `__proto__` property (shorthand)
|
||||||
|
info: |
|
||||||
|
Annex B defines an early error for duplicate PropertyName of `__proto__`,
|
||||||
|
but this does not apply to properties created from other productions.
|
||||||
|
|
||||||
|
B.3.1 __proto__ Property Names in Object Initializers
|
||||||
|
|
||||||
|
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 .
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var __proto__ = 2;
|
||||||
|
var obj = {
|
||||||
|
__proto__,
|
||||||
|
__proto__,
|
||||||
|
};
|
||||||
|
|
||||||
|
assert(obj.hasOwnProperty("__proto__"));
|
||||||
|
assert.sameValue(obj.__proto__, 2);
|
Loading…
x
Reference in New Issue
Block a user