Skip to content
Snippets Groups Projects
Commit 968a2e04 authored by Leo Balter's avatar Leo Balter Committed by Rick Waldron
Browse files

Add tests to verify valid object shorthand properties

Fixes #1202
parent 804e0083
No related branches found
No related tags found
No related merge requests found
// 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]});
// 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 property names. (0)
esid: sec-object-initializer
info: |
PropertyDefinition:
IdentifierReference
CoverInitializedName
PropertyName : AssignmentExpression
MethodDefinition
negative:
phase: early
type: SyntaxError
---*/
throw "Test262: This statement should not be evaluated.";
({0});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment