js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-await-expression.js
raw symbols SCIP| 1 | // |reftest| module async |
| 2 | // This file was procedurally generated from the following sources: |
| 3 | // - src/computed-property-names/computed-property-name-from-await-expression.case |
| 4 | // - src/computed-property-names/evaluation/class-expression-accessors.template |
| 5 | /*--- |
| 6 | description: Computed property name from condition expression (ComputedPropertyName in ClassExpression) |
| 7 | esid: prod-ComputedPropertyName |
| 8 | features: [computed-property-names, top-level-await] |
| 9 | flags: [generated, async, module] |
| 10 | info: | |
| 11 | ClassExpression: |
| 12 | classBindingIdentifier opt ClassTail |
| 13 | |
| 14 | ClassTail: |
| 15 | ClassHeritage opt { ClassBody opt } |
| 16 | |
| 17 | ClassBody: |
| 18 | ClassElementList |
| 19 | |
| 20 | ClassElementList: |
| 21 | ClassElement |
| 22 | |
| 23 | ClassElement: |
| 24 | MethodDefinition |
| 25 | |
| 26 | MethodDefinition: |
| 27 | PropertyName ... |
| 28 | get PropertyName ... |
| 29 | set PropertyName ... |
| 30 | |
| 31 | PropertyName: |
| 32 | ComputedPropertyName |
| 33 | |
| 34 | ComputedPropertyName: |
| 35 | [ AssignmentExpression ] |
| 36 | ---*/ |
| 37 | try { |
| 38 | |
| 39 | |
| 40 | let C = class { |
| 41 | get [await 9]() { |
| 42 | return 9; |
| 43 | } |
| 44 | |
| 45 | set [await 9](v) { |
| 46 | return 9; |
| 47 | } |
| 48 | |
| 49 | static get [await 9]() { |
| 50 | return 9; |
| 51 | } |
| 52 | |
| 53 | static set [await 9](v) { |
| 54 | return 9; |
| 55 | } |
| 56 | }; |
| 57 | |
| 58 | let c = new C(); |
| 59 | |
| 60 | assert.sameValue( |
| 61 | c[await 9], |
| 62 | 9 |
| 63 | ); |
| 64 | assert.sameValue( |
| 65 | c[await 9] = 9, |
| 66 | 9 |
| 67 | ); |
| 68 | |
| 69 | assert.sameValue( |
| 70 | C[await 9], |
| 71 | 9 |
| 72 | ); |
| 73 | assert.sameValue( |
| 74 | C[await 9] = 9, |
| 75 | 9 |
| 76 | ); |
| 77 | assert.sameValue( |
| 78 | c[String(await 9)], |
| 79 | 9 |
| 80 | ); |
| 81 | assert.sameValue( |
| 82 | c[String(await 9)] = 9, |
| 83 | 9 |
| 84 | ); |
| 85 | |
| 86 | assert.sameValue( |
| 87 | C[String(await 9)], |
| 88 | 9 |
| 89 | ); |
| 90 | assert.sameValue( |
| 91 | C[String(await 9)] = 9, |
| 92 | 9 |
| 93 | ); |
| 94 | |
| 95 | } catch (e) { |
| 96 | $DONE(e); |
| 97 | } |
| 98 | $DONE(); |