mirror of https://github.com/tc39/test262.git
30 lines
643 B
JavaScript
30 lines
643 B
JavaScript
|
// Copyright (C) 2017 The V8 Project authors. All rights reserved.
|
||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||
|
|
||
|
/*---
|
||
|
description: >
|
||
|
Object literal shorthands are only valid with identifier references,
|
||
|
not computed property names.
|
||
|
esid: sec-object-initializer
|
||
|
info: |
|
||
|
PropertyDefinition:
|
||
|
IdentifierReference
|
||
|
CoverInitializedName
|
||
|
PropertyName : AssignmentExpression
|
||
|
MethodDefinition
|
||
|
|
||
|
PropertyName:
|
||
|
LiteralPropertyName
|
||
|
ComputedPropertyName
|
||
|
negative:
|
||
|
phase: early
|
||
|
type: SyntaxError
|
||
|
---*/
|
||
|
|
||
|
var x = "y";
|
||
|
var y = 42;
|
||
|
|
||
|
throw "Test262: This statement should not be evaluated.";
|
||
|
|
||
|
({[x]});
|