From 9c78f42b5bef8a1e19bec8470da52dca91357d2d Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Fri, 25 Sep 2020 13:21:27 -0400 Subject: [PATCH 1/4] Coverage: computed property names from await expression --- ...omputed-property-name-from-await-expression.case | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/computed-property-names/computed-property-name-from-await-expression.case 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..5d5bbdb6018 --- /dev/null +++ b/src/computed-property-names/computed-property-name-from-await-expression.case @@ -0,0 +1,13 @@ +// 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: [module] +---*/ +//- ComputedPropertyName +await 9 +//- value +9 From faf0f674661ded008ccd08333872ecd8ee185c79 Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Fri, 25 Sep 2020 13:21:51 -0400 Subject: [PATCH 2/4] Generate tests --- ...ted-property-name-from-await-expression.js | 74 +++++++++++++++++++ ...ted-property-name-from-await-expression.js | 56 ++++++++++++++ ...ted-property-name-from-await-expression.js | 53 +++++++++++++ ...ted-property-name-from-await-expression.js | 57 ++++++++++++++ ...ted-property-name-from-await-expression.js | 34 +++++++++ ...ted-property-name-from-await-expression.js | 34 +++++++++ ...ted-property-name-from-await-expression.js | 74 +++++++++++++++++++ ...ted-property-name-from-await-expression.js | 56 ++++++++++++++ ...ted-property-name-from-await-expression.js | 53 +++++++++++++ ...ted-property-name-from-await-expression.js | 57 ++++++++++++++ 10 files changed, 548 insertions(+) create mode 100644 test/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-await-expression.js create mode 100644 test/language/expressions/class/cpn-class-expr-computed-property-name-from-await-expression.js create mode 100644 test/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-await-expression.js create mode 100644 test/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-await-expression.js create mode 100644 test/language/expressions/object/cpn-obj-lit-computed-property-name-from-await-expression.js create mode 100644 test/language/expressions/object/cpn-yield-expr-computed-property-name-from-await-expression.js create mode 100644 test/language/statements/class/cpn-class-decl-accessors-computed-property-name-from-await-expression.js create mode 100644 test/language/statements/class/cpn-class-decl-computed-property-name-from-await-expression.js create mode 100644 test/language/statements/class/cpn-class-decl-fields-computed-property-name-from-await-expression.js create mode 100644 test/language/statements/class/cpn-class-decl-fields-methods-computed-property-name-from-await-expression.js 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..ca3f0ecccfe --- /dev/null +++ b/test/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-await-expression.js @@ -0,0 +1,74 @@ +// 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, 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 ] +---*/ + + +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 +); 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..12c27e1b000 --- /dev/null +++ b/test/language/expressions/class/cpn-class-expr-computed-property-name-from-await-expression.js @@ -0,0 +1,56 @@ +// 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, 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 ] +---*/ + + +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 +); 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..adbe81f2284 --- /dev/null +++ b/test/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-await-expression.js @@ -0,0 +1,53 @@ +// 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, 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 ] +---*/ + + +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 +); 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..781bd4d8cff --- /dev/null +++ b/test/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-await-expression.js @@ -0,0 +1,57 @@ +// 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, 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 ] +---*/ + + +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 +); 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..ef644ded6bd --- /dev/null +++ b/test/language/expressions/object/cpn-obj-lit-computed-property-name-from-await-expression.js @@ -0,0 +1,34 @@ +// 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, module] +info: | + ObjectLiteral: + { PropertyDefinitionList } + + PropertyDefinitionList: + PropertyDefinition + + PropertyDefinition: + PropertyName: AssignmentExpression + + PropertyName: + ComputedPropertyName + + ComputedPropertyName: + [ AssignmentExpression ] +---*/ + + +let o = { + [await 9]: 9 +}; + +assert.sameValue( + o[await 9], + 9 +); 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..6ace25db5e4 --- /dev/null +++ b/test/language/expressions/object/cpn-yield-expr-computed-property-name-from-await-expression.js @@ -0,0 +1,34 @@ +// 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, module] +info: | + ObjectLiteral: + { PropertyDefinitionList } + + PropertyDefinitionList: + PropertyDefinition + + PropertyDefinition: + PropertyName: AssignmentExpression + + PropertyName: + ComputedPropertyName + + ComputedPropertyName: + [ AssignmentExpression ] +---*/ + + +let o = { + [await 9]: 9 +}; + +assert.sameValue( + o[await 9], + 9 +); 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..a053165d541 --- /dev/null +++ b/test/language/statements/class/cpn-class-decl-accessors-computed-property-name-from-await-expression.js @@ -0,0 +1,74 @@ +// 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, 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 ] +---*/ + + +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 +); 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..dba2d443d6e --- /dev/null +++ b/test/language/statements/class/cpn-class-decl-computed-property-name-from-await-expression.js @@ -0,0 +1,56 @@ +// 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, 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 ] +---*/ + + +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 +); 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..7b4076beb4d --- /dev/null +++ b/test/language/statements/class/cpn-class-decl-fields-computed-property-name-from-await-expression.js @@ -0,0 +1,53 @@ +// 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, 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 ] +---*/ + + +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 +); 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..d60db2db957 --- /dev/null +++ b/test/language/statements/class/cpn-class-decl-fields-methods-computed-property-name-from-await-expression.js @@ -0,0 +1,57 @@ +// 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, 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 ] +---*/ + + +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 +); From dca1f3e0f73df594ff37328ff1b991aa112694ce Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Fri, 25 Sep 2020 13:40:48 -0400 Subject: [PATCH 3/4] Make test async --- .../computed-property-name-from-await-expression.case | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 index 5d5bbdb6018..d3ba2c6ba8a 100644 --- a/src/computed-property-names/computed-property-name-from-await-expression.case +++ b/src/computed-property-names/computed-property-name-from-await-expression.case @@ -5,9 +5,16 @@ desc: Computed property name from condition expression template: evaluation features: [computed-property-names, top-level-await] -flags: [module] +flags: [async, module] ---*/ +//- setup +try { //- ComputedPropertyName await 9 //- value 9 +//- teardown +} catch (e) { + $DONE(e); +} +$DONE(); From 0a39b6295e682454c998d1517a63d2b88964a3a3 Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Fri, 25 Sep 2020 13:40:56 -0400 Subject: [PATCH 4/4] Generate tests --- ...ted-property-name-from-await-expression.js | 25 ++++++++++++++++++- ...ted-property-name-from-await-expression.js | 16 +++++++++++- ...ted-property-name-from-await-expression.js | 16 +++++++++++- ...ted-property-name-from-await-expression.js | 16 +++++++++++- ...ted-property-name-from-await-expression.js | 12 ++++++++- ...ted-property-name-from-await-expression.js | 12 ++++++++- ...ted-property-name-from-await-expression.js | 25 ++++++++++++++++++- ...ted-property-name-from-await-expression.js | 16 +++++++++++- ...ted-property-name-from-await-expression.js | 16 +++++++++++- ...ted-property-name-from-await-expression.js | 16 +++++++++++- 10 files changed, 160 insertions(+), 10 deletions(-) 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 index ca3f0ecccfe..bdf89f21366 100644 --- 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 @@ -5,7 +5,7 @@ description: Computed property name from condition expression (ComputedPropertyName in ClassExpression) esid: prod-ComputedPropertyName features: [computed-property-names, top-level-await] -flags: [generated, module] +flags: [generated, async, module] info: | ClassExpression: classBindingIdentifier opt ClassTail @@ -33,6 +33,7 @@ info: | ComputedPropertyName: [ AssignmentExpression ] ---*/ +try { let C = class { @@ -72,3 +73,25 @@ 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 index 12c27e1b000..5cdd1f4fd8d 100644 --- 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 @@ -5,7 +5,7 @@ description: Computed property name from condition expression (ComputedPropertyName in ClassExpression) esid: prod-ComputedPropertyName features: [computed-property-names, top-level-await] -flags: [generated, module] +flags: [generated, async, module] info: | ClassExpression: classBindingIdentifier opt ClassTail @@ -33,6 +33,7 @@ info: | ComputedPropertyName: [ AssignmentExpression ] ---*/ +try { let C = class { @@ -54,3 +55,16 @@ 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 index adbe81f2284..da93ec456c5 100644 --- 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 @@ -5,7 +5,7 @@ description: Computed property name from condition expression (ComputedPropertyName in ClassExpression) esid: prod-ComputedPropertyName features: [computed-property-names, top-level-await] -flags: [generated, module] +flags: [generated, async, module] info: | ClassExpression: classBindingIdentifier opt ClassTail @@ -33,6 +33,7 @@ info: | ComputedPropertyName: [ AssignmentExpression ] ---*/ +try { let C = class { @@ -51,3 +52,16 @@ 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 index 781bd4d8cff..587fea8721d 100644 --- 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 @@ -5,7 +5,7 @@ description: Computed property name from condition expression (ComputedPropertyName in ClassExpression) esid: prod-ComputedPropertyName features: [computed-property-names, top-level-await] -flags: [generated, module] +flags: [generated, async, module] info: | ClassExpression: classBindingIdentifier opt ClassTail @@ -33,6 +33,7 @@ info: | ComputedPropertyName: [ AssignmentExpression ] ---*/ +try { let C = class { @@ -55,3 +56,16 @@ 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 index ef644ded6bd..cf6d9cecaaf 100644 --- 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 @@ -5,7 +5,7 @@ description: Computed property name from condition expression (ComputedPropertyName in ObjectLiteral) esid: prod-ComputedPropertyName features: [computed-property-names, top-level-await] -flags: [generated, module] +flags: [generated, async, module] info: | ObjectLiteral: { PropertyDefinitionList } @@ -22,6 +22,7 @@ info: | ComputedPropertyName: [ AssignmentExpression ] ---*/ +try { let o = { @@ -32,3 +33,12 @@ 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 index 6ace25db5e4..04f69e1d066 100644 --- 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 @@ -5,7 +5,7 @@ description: Computed property name from condition expression (ComputedPropertyName in ObjectLiteral) esid: prod-ComputedPropertyName features: [computed-property-names, top-level-await] -flags: [generated, module] +flags: [generated, async, module] info: | ObjectLiteral: { PropertyDefinitionList } @@ -22,6 +22,7 @@ info: | ComputedPropertyName: [ AssignmentExpression ] ---*/ +try { let o = { @@ -32,3 +33,12 @@ 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 index a053165d541..47e5ba33198 100644 --- 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 @@ -5,7 +5,7 @@ description: Computed property name from condition expression (ComputedPropertyName in ClassDeclaration) esid: prod-ComputedPropertyName features: [computed-property-names, top-level-await] -flags: [generated, module] +flags: [generated, async, module] info: | ClassExpression: classBindingIdentifier opt ClassTail @@ -33,6 +33,7 @@ info: | ComputedPropertyName: [ AssignmentExpression ] ---*/ +try { class C { @@ -72,3 +73,25 @@ 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 index dba2d443d6e..8410d64368d 100644 --- 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 @@ -5,7 +5,7 @@ description: Computed property name from condition expression (ComputedPropertyName in ClassDeclaration) esid: prod-ComputedPropertyName features: [computed-property-names, top-level-await] -flags: [generated, module] +flags: [generated, async, module] info: | ClassExpression: classBindingIdentifier opt ClassTail @@ -33,6 +33,7 @@ info: | ComputedPropertyName: [ AssignmentExpression ] ---*/ +try { class C { @@ -54,3 +55,16 @@ 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 index 7b4076beb4d..692f6f2db17 100644 --- 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 @@ -5,7 +5,7 @@ description: Computed property name from condition expression (ComputedPropertyName in ClassExpression) esid: prod-ComputedPropertyName features: [computed-property-names, top-level-await] -flags: [generated, module] +flags: [generated, async, module] info: | ClassExpression: classBindingIdentifier opt ClassTail @@ -33,6 +33,7 @@ info: | ComputedPropertyName: [ AssignmentExpression ] ---*/ +try { let C = class { @@ -51,3 +52,16 @@ 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 index d60db2db957..ce010b0dbb1 100644 --- 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 @@ -5,7 +5,7 @@ description: Computed property name from condition expression (ComputedPropertyName in ClassExpression) esid: prod-ComputedPropertyName features: [computed-property-names, top-level-await] -flags: [generated, module] +flags: [generated, async, module] info: | ClassExpression: classBindingIdentifier opt ClassTail @@ -33,6 +33,7 @@ info: | ComputedPropertyName: [ AssignmentExpression ] ---*/ +try { let C = class { @@ -55,3 +56,16 @@ 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();