test262/test/language/expressions/object/cpn-yield-expr-computed-pro...

35 lines
786 B
JavaScript
Raw Normal View History

2020-09-17 20:13:46 +02:00
// This file was procedurally generated from the following sources:
// - src/computed-property-names/computed-property-name-from-yield-expression.case
2020-09-25 18:52:36 +02:00
// - src/computed-property-names/evaluation/yield-expression.template
2020-09-17 20:13:46 +02:00
/*---
description: Computed property name from condition expression (ComputedPropertyName in ObjectLiteral)
esid: prod-ComputedPropertyName
features: [computed-property-names]
flags: [generated]
info: |
ObjectLiteral:
{ PropertyDefinitionList }
PropertyDefinitionList:
PropertyDefinition
PropertyDefinition:
PropertyName: AssignmentExpression
PropertyName:
ComputedPropertyName
ComputedPropertyName:
[ AssignmentExpression ]
---*/
let o = {
[true ? 1 : 2]: 2
};
assert.sameValue(
o[true ? 1 : 2],
2
);