diff --git a/src/computed-property-names/computed-property-name-from-await-expression.case b/src/computed-property-names/computed-property-name-from-await-expression.case new file mode 100644 index 00000000000..d3ba2c6ba8a --- /dev/null +++ b/src/computed-property-names/computed-property-name-from-await-expression.case @@ -0,0 +1,20 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Computed property name from condition expression +template: evaluation +features: [computed-property-names, top-level-await] +flags: [async, module] +---*/ +//- setup +try { +//- ComputedPropertyName +await 9 +//- value +9 +//- teardown +} catch (e) { + $DONE(e); +} +$DONE(); diff --git a/test/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-await-expression.js b/test/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-await-expression.js new file mode 100644 index 00000000000..bdf89f21366 --- /dev/null +++ b/test/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-await-expression.js @@ -0,0 +1,97 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-await-expression.case +// - src/computed-property-names/evaluation/class-expression-accessors.template +/*--- +description: Computed property name from condition expression (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names, top-level-await] +flags: [generated, async, module] +info: | + ClassExpression: + classBindingIdentifier opt ClassTail + + ClassTail: + ClassHeritage opt { ClassBody opt } + + ClassBody: + ClassElementList + + ClassElementList: + ClassElement + + ClassElement: + MethodDefinition + + MethodDefinition: + PropertyName ... + get PropertyName ... + set PropertyName ... + + PropertyName: + ComputedPropertyName + + ComputedPropertyName: + [ AssignmentExpression ] +---*/ +try { + + +let C = class { + get [await 9]() { + return 9; + } + + set [await 9](v) { + return 9; + } + + static get [await 9]() { + return 9; + } + + static set [await 9](v) { + return 9; + } +}; + +let c = new C(); + +assert.sameValue( + c[await 9], + 9 +); +assert.sameValue( + c[await 9] = 9, + 9 +); + +assert.sameValue( + C[await 9], + 9 +); +assert.sameValue( + C[await 9] = 9, + 9 +); +assert.sameValue( + c[String(await 9)], + 9 +); +assert.sameValue( + c[String(await 9)] = 9, + 9 +); + +assert.sameValue( + C[String(await 9)], + 9 +); +assert.sameValue( + C[String(await 9)] = 9, + 9 +); + +} catch (e) { + $DONE(e); +} +$DONE(); diff --git a/test/language/expressions/class/cpn-class-expr-computed-property-name-from-await-expression.js b/test/language/expressions/class/cpn-class-expr-computed-property-name-from-await-expression.js new file mode 100644 index 00000000000..5cdd1f4fd8d --- /dev/null +++ b/test/language/expressions/class/cpn-class-expr-computed-property-name-from-await-expression.js @@ -0,0 +1,70 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-await-expression.case +// - src/computed-property-names/evaluation/class-expression.template +/*--- +description: Computed property name from condition expression (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names, top-level-await] +flags: [generated, async, module] +info: | + ClassExpression: + classBindingIdentifier opt ClassTail + + ClassTail: + ClassHeritage opt { ClassBody opt } + + ClassBody: + ClassElementList + + ClassElementList: + ClassElement + + ClassElement: + MethodDefinition + + MethodDefinition: + PropertyName ... + get PropertyName ... + set PropertyName ... + + PropertyName: + ComputedPropertyName + + ComputedPropertyName: + [ AssignmentExpression ] +---*/ +try { + + +let C = class { + [await 9]() { + return 9; + } + static [await 9]() { + return 9; + } +}; + +let c = new C(); + +assert.sameValue( + c[await 9](), + 9 +); +assert.sameValue( + C[await 9](), + 9 +); +assert.sameValue( + c[String(await 9)](), + 9 +); +assert.sameValue( + C[String(await 9)](), + 9 +); + +} catch (e) { + $DONE(e); +} +$DONE(); diff --git a/test/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-await-expression.js b/test/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-await-expression.js new file mode 100644 index 00000000000..da93ec456c5 --- /dev/null +++ b/test/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-await-expression.js @@ -0,0 +1,67 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-await-expression.case +// - src/computed-property-names/evaluation/class-expression-fields.template +/*--- +description: Computed property name from condition expression (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names, top-level-await] +flags: [generated, async, module] +info: | + ClassExpression: + classBindingIdentifier opt ClassTail + + ClassTail: + ClassHeritage opt { ClassBody opt } + + ClassBody: + ClassElementList + + ClassElementList: + ClassElement + + ClassElement: + MethodDefinition + + MethodDefinition: + PropertyName ... + get PropertyName ... + set PropertyName ... + + PropertyName: + ComputedPropertyName + + ComputedPropertyName: + [ AssignmentExpression ] +---*/ +try { + + +let C = class { + [await 9] = 9; + + static [await 9] = 9; +}; + +let c = new C(); + +assert.sameValue( + c[await 9], + 9 +); +assert.sameValue( + C[await 9], + 9 +); +assert.sameValue( + c[String(await 9)], + 9 +); +assert.sameValue( + C[String(await 9)], + 9 +); + +} catch (e) { + $DONE(e); +} +$DONE(); diff --git a/test/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-await-expression.js b/test/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-await-expression.js new file mode 100644 index 00000000000..587fea8721d --- /dev/null +++ b/test/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-await-expression.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-await-expression.case +// - src/computed-property-names/evaluation/class-expression-fields-methods.template +/*--- +description: Computed property name from condition expression (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names, top-level-await] +flags: [generated, async, module] +info: | + ClassExpression: + classBindingIdentifier opt ClassTail + + ClassTail: + ClassHeritage opt { ClassBody opt } + + ClassBody: + ClassElementList + + ClassElementList: + ClassElement + + ClassElement: + MethodDefinition + + MethodDefinition: + PropertyName ... + get PropertyName ... + set PropertyName ... + + PropertyName: + ComputedPropertyName + + ComputedPropertyName: + [ AssignmentExpression ] +---*/ +try { + + +let C = class { + [await 9] = () => { + return 9; + }; + + static [await 9] = () => { + return 9; + }; +}; + +let c = new C(); + +assert.sameValue( + c[await 9](), + 9 +); +assert.sameValue( + C[await 9](), + 9 +); +assert.sameValue( + c[String(await 9)](), + 9 +); +assert.sameValue( + C[String(await 9)](), + 9 +); + +} catch (e) { + $DONE(e); +} +$DONE(); diff --git a/test/language/expressions/object/cpn-obj-lit-computed-property-name-from-await-expression.js b/test/language/expressions/object/cpn-obj-lit-computed-property-name-from-await-expression.js new file mode 100644 index 00000000000..cf6d9cecaaf --- /dev/null +++ b/test/language/expressions/object/cpn-obj-lit-computed-property-name-from-await-expression.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-await-expression.case +// - src/computed-property-names/evaluation/object-literal.template +/*--- +description: Computed property name from condition expression (ComputedPropertyName in ObjectLiteral) +esid: prod-ComputedPropertyName +features: [computed-property-names, top-level-await] +flags: [generated, async, module] +info: | + ObjectLiteral: + { PropertyDefinitionList } + + PropertyDefinitionList: + PropertyDefinition + + PropertyDefinition: + PropertyName: AssignmentExpression + + PropertyName: + ComputedPropertyName + + ComputedPropertyName: + [ AssignmentExpression ] +---*/ +try { + + +let o = { + [await 9]: 9 +}; + +assert.sameValue( + o[await 9], + 9 +); +assert.sameValue( + o[String(await 9)], + 9 +); + +} catch (e) { + $DONE(e); +} +$DONE(); diff --git a/test/language/expressions/object/cpn-yield-expr-computed-property-name-from-await-expression.js b/test/language/expressions/object/cpn-yield-expr-computed-property-name-from-await-expression.js new file mode 100644 index 00000000000..04f69e1d066 --- /dev/null +++ b/test/language/expressions/object/cpn-yield-expr-computed-property-name-from-await-expression.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-await-expression.case +// - src/computed-property-names/evaluation/yield-expression.template +/*--- +description: Computed property name from condition expression (ComputedPropertyName in ObjectLiteral) +esid: prod-ComputedPropertyName +features: [computed-property-names, top-level-await] +flags: [generated, async, module] +info: | + ObjectLiteral: + { PropertyDefinitionList } + + PropertyDefinitionList: + PropertyDefinition + + PropertyDefinition: + PropertyName: AssignmentExpression + + PropertyName: + ComputedPropertyName + + ComputedPropertyName: + [ AssignmentExpression ] +---*/ +try { + + +let o = { + [await 9]: 9 +}; + +assert.sameValue( + o[await 9], + 9 +); +assert.sameValue( + o[String(await 9)], + 9 +); + +} catch (e) { + $DONE(e); +} +$DONE(); diff --git a/test/language/statements/class/cpn-class-decl-accessors-computed-property-name-from-await-expression.js b/test/language/statements/class/cpn-class-decl-accessors-computed-property-name-from-await-expression.js new file mode 100644 index 00000000000..47e5ba33198 --- /dev/null +++ b/test/language/statements/class/cpn-class-decl-accessors-computed-property-name-from-await-expression.js @@ -0,0 +1,97 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-await-expression.case +// - src/computed-property-names/evaluation/class-declaration-accessors.template +/*--- +description: Computed property name from condition expression (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names, top-level-await] +flags: [generated, async, module] +info: | + ClassExpression: + classBindingIdentifier opt ClassTail + + ClassTail: + ClassHeritage opt { ClassBody opt } + + ClassBody: + ClassElementList + + ClassElementList: + ClassElement + + ClassElement: + MethodDefinition + + MethodDefinition: + PropertyName ... + get PropertyName ... + set PropertyName ... + + PropertyName: + ComputedPropertyName + + ComputedPropertyName: + [ AssignmentExpression ] +---*/ +try { + + +class C { + get [await 9]() { + return 9; + } + + set [await 9](v) { + return 9; + } + + static get [await 9]() { + return 9; + } + + static set [await 9](v) { + return 9; + } +}; + +let c = new C(); + +assert.sameValue( + c[await 9], + 9 +); +assert.sameValue( + c[await 9] = 9, + 9 +); + +assert.sameValue( + C[await 9], + 9 +); +assert.sameValue( + C[await 9] = 9, + 9 +); +assert.sameValue( + c[String(await 9)], + 9 +); +assert.sameValue( + c[String(await 9)] = 9, + 9 +); + +assert.sameValue( + C[String(await 9)], + 9 +); +assert.sameValue( + C[String(await 9)] = 9, + 9 +); + +} catch (e) { + $DONE(e); +} +$DONE(); diff --git a/test/language/statements/class/cpn-class-decl-computed-property-name-from-await-expression.js b/test/language/statements/class/cpn-class-decl-computed-property-name-from-await-expression.js new file mode 100644 index 00000000000..8410d64368d --- /dev/null +++ b/test/language/statements/class/cpn-class-decl-computed-property-name-from-await-expression.js @@ -0,0 +1,70 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-await-expression.case +// - src/computed-property-names/evaluation/class-declaration.template +/*--- +description: Computed property name from condition expression (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names, top-level-await] +flags: [generated, async, module] +info: | + ClassExpression: + classBindingIdentifier opt ClassTail + + ClassTail: + ClassHeritage opt { ClassBody opt } + + ClassBody: + ClassElementList + + ClassElementList: + ClassElement + + ClassElement: + MethodDefinition + + MethodDefinition: + PropertyName ... + get PropertyName ... + set PropertyName ... + + PropertyName: + ComputedPropertyName + + ComputedPropertyName: + [ AssignmentExpression ] +---*/ +try { + + +class C { + [await 9]() { + return 9; + } + static [await 9]() { + return 9; + } +}; + +let c = new C(); + +assert.sameValue( + c[await 9](), + 9 +); +assert.sameValue( + C[await 9](), + 9 +); +assert.sameValue( + c[String(await 9)](), + 9 +); +assert.sameValue( + C[String(await 9)](), + 9 +); + +} catch (e) { + $DONE(e); +} +$DONE(); diff --git a/test/language/statements/class/cpn-class-decl-fields-computed-property-name-from-await-expression.js b/test/language/statements/class/cpn-class-decl-fields-computed-property-name-from-await-expression.js new file mode 100644 index 00000000000..692f6f2db17 --- /dev/null +++ b/test/language/statements/class/cpn-class-decl-fields-computed-property-name-from-await-expression.js @@ -0,0 +1,67 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-await-expression.case +// - src/computed-property-names/evaluation/class-declaration-fields.template +/*--- +description: Computed property name from condition expression (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names, top-level-await] +flags: [generated, async, module] +info: | + ClassExpression: + classBindingIdentifier opt ClassTail + + ClassTail: + ClassHeritage opt { ClassBody opt } + + ClassBody: + ClassElementList + + ClassElementList: + ClassElement + + ClassElement: + MethodDefinition + + MethodDefinition: + PropertyName ... + get PropertyName ... + set PropertyName ... + + PropertyName: + ComputedPropertyName + + ComputedPropertyName: + [ AssignmentExpression ] +---*/ +try { + + +let C = class { + [await 9] = 9; + + static [await 9] = 9; +}; + +let c = new C(); + +assert.sameValue( + c[await 9], + 9 +); +assert.sameValue( + C[await 9], + 9 +); +assert.sameValue( + c[String(await 9)], + 9 +); +assert.sameValue( + C[String(await 9)], + 9 +); + +} catch (e) { + $DONE(e); +} +$DONE(); diff --git a/test/language/statements/class/cpn-class-decl-fields-methods-computed-property-name-from-await-expression.js b/test/language/statements/class/cpn-class-decl-fields-methods-computed-property-name-from-await-expression.js new file mode 100644 index 00000000000..ce010b0dbb1 --- /dev/null +++ b/test/language/statements/class/cpn-class-decl-fields-methods-computed-property-name-from-await-expression.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-await-expression.case +// - src/computed-property-names/evaluation/class-declaration-fields-methods.template +/*--- +description: Computed property name from condition expression (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names, top-level-await] +flags: [generated, async, module] +info: | + ClassExpression: + classBindingIdentifier opt ClassTail + + ClassTail: + ClassHeritage opt { ClassBody opt } + + ClassBody: + ClassElementList + + ClassElementList: + ClassElement + + ClassElement: + MethodDefinition + + MethodDefinition: + PropertyName ... + get PropertyName ... + set PropertyName ... + + PropertyName: + ComputedPropertyName + + ComputedPropertyName: + [ AssignmentExpression ] +---*/ +try { + + +let C = class { + [await 9] = () => { + return 9; + }; + + static [await 9] = () => { + return 9; + }; +}; + +let c = new C(); + +assert.sameValue( + c[await 9](), + 9 +); +assert.sameValue( + C[await 9](), + 9 +); +assert.sameValue( + c[String(await 9)](), + 9 +); +assert.sameValue( + C[String(await 9)](), + 9 +); + +} catch (e) { + $DONE(e); +} +$DONE();