From 1ab47810d183178ef6b1aba180cc0398205f7494 Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Thu, 17 Sep 2020 14:13:46 -0400 Subject: [PATCH] Generate tests --- ...perty-name-from-additive-expression-add.js | 74 ++++++++++++++++++ ...-name-from-additive-expression-subtract.js | 74 ++++++++++++++++++ ...rty-name-from-arrow-function-expression.js | 74 ++++++++++++++++++ ...e-from-assignment-expression-assignment.js | 77 +++++++++++++++++++ ...e-from-assignment-expression-bitwise-or.js | 77 +++++++++++++++++++ ...ame-from-assignment-expression-coalesce.js | 77 +++++++++++++++++++ ...-from-assignment-expression-logical-and.js | 77 +++++++++++++++++++ ...e-from-assignment-expression-logical-or.js | 77 +++++++++++++++++++ ...me-from-async-arrow-function-expression.js | 74 ++++++++++++++++++ ...ty-name-from-condition-expression-false.js | 74 ++++++++++++++++++ ...rty-name-from-condition-expression-true.js | 74 ++++++++++++++++++ ...-name-from-decimal-e-notational-literal.js | 74 ++++++++++++++++++ ...uted-property-name-from-decimal-literal.js | 74 ++++++++++++++++++ ...erty-name-from-exponetiation-expression.js | 74 ++++++++++++++++++ ...-property-name-from-expression-coalesce.js | 77 +++++++++++++++++++ ...operty-name-from-expression-logical-and.js | 77 +++++++++++++++++++ ...roperty-name-from-expression-logical-or.js | 77 +++++++++++++++++++ ...property-name-from-function-declaration.js | 75 ++++++++++++++++++ ...-property-name-from-function-expression.js | 74 ++++++++++++++++++ ...ame-from-generator-function-declaration.js | 75 ++++++++++++++++++ ...-computed-property-name-from-identifier.js | 76 ++++++++++++++++++ ...-name-from-integer-e-notational-literal.js | 74 ++++++++++++++++++ ...d-property-name-from-integer-separators.js | 74 ++++++++++++++++++ ...essors-computed-property-name-from-math.js | 74 ++++++++++++++++++ ...name-from-multiplicative-expression-div.js | 74 ++++++++++++++++++ ...ame-from-multiplicative-expression-mult.js | 74 ++++++++++++++++++ ...uted-property-name-from-numeric-literal.js | 74 ++++++++++++++++++ ...puted-property-name-from-string-literal.js | 74 ++++++++++++++++++ ...ted-property-name-from-yield-expression.js | 74 ++++++++++++++++++ ...perty-name-from-additive-expression-add.js | 56 ++++++++++++++ ...-name-from-additive-expression-subtract.js | 56 ++++++++++++++ ...rty-name-from-arrow-function-expression.js | 56 ++++++++++++++ ...e-from-assignment-expression-assignment.js | 59 ++++++++++++++ ...e-from-assignment-expression-bitwise-or.js | 59 ++++++++++++++ ...ame-from-assignment-expression-coalesce.js | 59 ++++++++++++++ ...-from-assignment-expression-logical-and.js | 59 ++++++++++++++ ...e-from-assignment-expression-logical-or.js | 59 ++++++++++++++ ...me-from-async-arrow-function-expression.js | 56 ++++++++++++++ ...ty-name-from-condition-expression-false.js | 56 ++++++++++++++ ...rty-name-from-condition-expression-true.js | 56 ++++++++++++++ ...-name-from-decimal-e-notational-literal.js | 56 ++++++++++++++ ...uted-property-name-from-decimal-literal.js | 56 ++++++++++++++ ...erty-name-from-exponetiation-expression.js | 56 ++++++++++++++ ...-property-name-from-expression-coalesce.js | 59 ++++++++++++++ ...operty-name-from-expression-logical-and.js | 59 ++++++++++++++ ...roperty-name-from-expression-logical-or.js | 59 ++++++++++++++ ...property-name-from-function-declaration.js | 57 ++++++++++++++ ...-property-name-from-function-expression.js | 56 ++++++++++++++ ...ame-from-generator-function-declaration.js | 57 ++++++++++++++ ...-computed-property-name-from-identifier.js | 58 ++++++++++++++ ...-name-from-integer-e-notational-literal.js | 56 ++++++++++++++ ...d-property-name-from-integer-separators.js | 56 ++++++++++++++ .../cpn-computed-property-name-from-math.js | 56 ++++++++++++++ ...name-from-multiplicative-expression-div.js | 56 ++++++++++++++ ...ame-from-multiplicative-expression-mult.js | 56 ++++++++++++++ ...uted-property-name-from-numeric-literal.js | 56 ++++++++++++++ ...puted-property-name-from-string-literal.js | 56 ++++++++++++++ ...ted-property-name-from-yield-expression.js | 56 ++++++++++++++ ...perty-name-from-additive-expression-add.js | 53 +++++++++++++ ...-name-from-additive-expression-subtract.js | 53 +++++++++++++ ...rty-name-from-arrow-function-expression.js | 53 +++++++++++++ ...e-from-assignment-expression-assignment.js | 56 ++++++++++++++ ...e-from-assignment-expression-bitwise-or.js | 56 ++++++++++++++ ...ame-from-assignment-expression-coalesce.js | 56 ++++++++++++++ ...-from-assignment-expression-logical-and.js | 56 ++++++++++++++ ...e-from-assignment-expression-logical-or.js | 56 ++++++++++++++ ...me-from-async-arrow-function-expression.js | 53 +++++++++++++ ...ty-name-from-condition-expression-false.js | 53 +++++++++++++ ...rty-name-from-condition-expression-true.js | 53 +++++++++++++ ...-name-from-decimal-e-notational-literal.js | 53 +++++++++++++ ...uted-property-name-from-decimal-literal.js | 53 +++++++++++++ ...erty-name-from-exponetiation-expression.js | 53 +++++++++++++ ...-property-name-from-expression-coalesce.js | 56 ++++++++++++++ ...operty-name-from-expression-logical-and.js | 56 ++++++++++++++ ...roperty-name-from-expression-logical-or.js | 56 ++++++++++++++ ...property-name-from-function-declaration.js | 54 +++++++++++++ ...-property-name-from-function-expression.js | 53 +++++++++++++ ...ame-from-generator-function-declaration.js | 54 +++++++++++++ ...-computed-property-name-from-identifier.js | 55 +++++++++++++ ...-name-from-integer-e-notational-literal.js | 53 +++++++++++++ ...d-property-name-from-integer-separators.js | 53 +++++++++++++ ...fields-computed-property-name-from-math.js | 53 +++++++++++++ ...name-from-multiplicative-expression-div.js | 53 +++++++++++++ ...ame-from-multiplicative-expression-mult.js | 53 +++++++++++++ ...uted-property-name-from-numeric-literal.js | 53 +++++++++++++ ...puted-property-name-from-string-literal.js | 53 +++++++++++++ ...ted-property-name-from-yield-expression.js | 53 +++++++++++++ ...perty-name-from-additive-expression-add.js | 57 ++++++++++++++ ...-name-from-additive-expression-subtract.js | 57 ++++++++++++++ ...rty-name-from-arrow-function-expression.js | 57 ++++++++++++++ ...e-from-assignment-expression-assignment.js | 60 +++++++++++++++ ...e-from-assignment-expression-bitwise-or.js | 60 +++++++++++++++ ...ame-from-assignment-expression-coalesce.js | 60 +++++++++++++++ ...-from-assignment-expression-logical-and.js | 60 +++++++++++++++ ...e-from-assignment-expression-logical-or.js | 60 +++++++++++++++ ...me-from-async-arrow-function-expression.js | 57 ++++++++++++++ ...ty-name-from-condition-expression-false.js | 57 ++++++++++++++ ...rty-name-from-condition-expression-true.js | 57 ++++++++++++++ ...-name-from-decimal-e-notational-literal.js | 57 ++++++++++++++ ...uted-property-name-from-decimal-literal.js | 57 ++++++++++++++ ...erty-name-from-exponetiation-expression.js | 57 ++++++++++++++ ...-property-name-from-expression-coalesce.js | 60 +++++++++++++++ ...operty-name-from-expression-logical-and.js | 60 +++++++++++++++ ...roperty-name-from-expression-logical-or.js | 60 +++++++++++++++ ...property-name-from-function-declaration.js | 58 ++++++++++++++ ...-property-name-from-function-expression.js | 57 ++++++++++++++ ...ame-from-generator-function-declaration.js | 58 ++++++++++++++ ...-computed-property-name-from-identifier.js | 59 ++++++++++++++ ...-name-from-integer-e-notational-literal.js | 57 ++++++++++++++ ...d-property-name-from-integer-separators.js | 57 ++++++++++++++ ...ethods-computed-property-name-from-math.js | 57 ++++++++++++++ ...name-from-multiplicative-expression-div.js | 57 ++++++++++++++ ...ame-from-multiplicative-expression-mult.js | 57 ++++++++++++++ ...uted-property-name-from-numeric-literal.js | 57 ++++++++++++++ ...puted-property-name-from-string-literal.js | 57 ++++++++++++++ ...ted-property-name-from-yield-expression.js | 57 ++++++++++++++ ...perty-name-from-additive-expression-add.js | 34 ++++++++ ...-name-from-additive-expression-subtract.js | 34 ++++++++ ...rty-name-from-arrow-function-expression.js | 34 ++++++++ ...e-from-assignment-expression-assignment.js | 37 +++++++++ ...e-from-assignment-expression-bitwise-or.js | 37 +++++++++ ...ame-from-assignment-expression-coalesce.js | 37 +++++++++ ...-from-assignment-expression-logical-and.js | 37 +++++++++ ...e-from-assignment-expression-logical-or.js | 37 +++++++++ ...me-from-async-arrow-function-expression.js | 34 ++++++++ ...ty-name-from-condition-expression-false.js | 34 ++++++++ ...rty-name-from-condition-expression-true.js | 34 ++++++++ ...-name-from-decimal-e-notational-literal.js | 34 ++++++++ ...uted-property-name-from-decimal-literal.js | 34 ++++++++ ...erty-name-from-exponetiation-expression.js | 34 ++++++++ ...-property-name-from-expression-coalesce.js | 37 +++++++++ ...operty-name-from-expression-logical-and.js | 37 +++++++++ ...roperty-name-from-expression-logical-or.js | 37 +++++++++ ...property-name-from-function-declaration.js | 35 +++++++++ ...-property-name-from-function-expression.js | 34 ++++++++ ...ame-from-generator-function-declaration.js | 35 +++++++++ ...-computed-property-name-from-identifier.js | 36 +++++++++ ...-name-from-integer-e-notational-literal.js | 34 ++++++++ ...d-property-name-from-integer-separators.js | 34 ++++++++ .../cpn-computed-property-name-from-math.js | 34 ++++++++ ...name-from-multiplicative-expression-div.js | 34 ++++++++ ...ame-from-multiplicative-expression-mult.js | 34 ++++++++ ...uted-property-name-from-numeric-literal.js | 34 ++++++++ ...puted-property-name-from-string-literal.js | 34 ++++++++ ...ted-property-name-from-yield-expression.js | 34 ++++++++ ...perty-name-from-additive-expression-add.js | 74 ++++++++++++++++++ ...-name-from-additive-expression-subtract.js | 74 ++++++++++++++++++ ...rty-name-from-arrow-function-expression.js | 74 ++++++++++++++++++ ...e-from-assignment-expression-assignment.js | 77 +++++++++++++++++++ ...e-from-assignment-expression-bitwise-or.js | 77 +++++++++++++++++++ ...ame-from-assignment-expression-coalesce.js | 77 +++++++++++++++++++ ...-from-assignment-expression-logical-and.js | 77 +++++++++++++++++++ ...e-from-assignment-expression-logical-or.js | 77 +++++++++++++++++++ ...me-from-async-arrow-function-expression.js | 74 ++++++++++++++++++ ...ty-name-from-condition-expression-false.js | 74 ++++++++++++++++++ ...rty-name-from-condition-expression-true.js | 74 ++++++++++++++++++ ...-name-from-decimal-e-notational-literal.js | 74 ++++++++++++++++++ ...uted-property-name-from-decimal-literal.js | 74 ++++++++++++++++++ ...erty-name-from-exponetiation-expression.js | 74 ++++++++++++++++++ ...-property-name-from-expression-coalesce.js | 77 +++++++++++++++++++ ...operty-name-from-expression-logical-and.js | 77 +++++++++++++++++++ ...roperty-name-from-expression-logical-or.js | 77 +++++++++++++++++++ ...property-name-from-function-declaration.js | 75 ++++++++++++++++++ ...-property-name-from-function-expression.js | 74 ++++++++++++++++++ ...ame-from-generator-function-declaration.js | 75 ++++++++++++++++++ ...-computed-property-name-from-identifier.js | 76 ++++++++++++++++++ ...-name-from-integer-e-notational-literal.js | 74 ++++++++++++++++++ ...d-property-name-from-integer-separators.js | 74 ++++++++++++++++++ ...essors-computed-property-name-from-math.js | 74 ++++++++++++++++++ ...name-from-multiplicative-expression-div.js | 74 ++++++++++++++++++ ...ame-from-multiplicative-expression-mult.js | 74 ++++++++++++++++++ ...uted-property-name-from-numeric-literal.js | 74 ++++++++++++++++++ ...puted-property-name-from-string-literal.js | 74 ++++++++++++++++++ ...ted-property-name-from-yield-expression.js | 74 ++++++++++++++++++ ...perty-name-from-additive-expression-add.js | 56 ++++++++++++++ ...-name-from-additive-expression-subtract.js | 56 ++++++++++++++ ...rty-name-from-arrow-function-expression.js | 56 ++++++++++++++ ...e-from-assignment-expression-assignment.js | 59 ++++++++++++++ ...e-from-assignment-expression-bitwise-or.js | 59 ++++++++++++++ ...ame-from-assignment-expression-coalesce.js | 59 ++++++++++++++ ...-from-assignment-expression-logical-and.js | 59 ++++++++++++++ ...e-from-assignment-expression-logical-or.js | 59 ++++++++++++++ ...me-from-async-arrow-function-expression.js | 56 ++++++++++++++ ...ty-name-from-condition-expression-false.js | 56 ++++++++++++++ ...rty-name-from-condition-expression-true.js | 56 ++++++++++++++ ...-name-from-decimal-e-notational-literal.js | 56 ++++++++++++++ ...uted-property-name-from-decimal-literal.js | 56 ++++++++++++++ ...erty-name-from-exponetiation-expression.js | 56 ++++++++++++++ ...-property-name-from-expression-coalesce.js | 59 ++++++++++++++ ...operty-name-from-expression-logical-and.js | 59 ++++++++++++++ ...roperty-name-from-expression-logical-or.js | 59 ++++++++++++++ ...property-name-from-function-declaration.js | 57 ++++++++++++++ ...-property-name-from-function-expression.js | 56 ++++++++++++++ ...ame-from-generator-function-declaration.js | 57 ++++++++++++++ ...-computed-property-name-from-identifier.js | 58 ++++++++++++++ ...-name-from-integer-e-notational-literal.js | 56 ++++++++++++++ ...d-property-name-from-integer-separators.js | 56 ++++++++++++++ .../cpn-computed-property-name-from-math.js | 56 ++++++++++++++ ...name-from-multiplicative-expression-div.js | 56 ++++++++++++++ ...ame-from-multiplicative-expression-mult.js | 56 ++++++++++++++ ...uted-property-name-from-numeric-literal.js | 56 ++++++++++++++ ...puted-property-name-from-string-literal.js | 56 ++++++++++++++ ...ted-property-name-from-yield-expression.js | 56 ++++++++++++++ ...perty-name-from-additive-expression-add.js | 53 +++++++++++++ ...-name-from-additive-expression-subtract.js | 53 +++++++++++++ ...rty-name-from-arrow-function-expression.js | 53 +++++++++++++ ...e-from-assignment-expression-assignment.js | 56 ++++++++++++++ ...e-from-assignment-expression-bitwise-or.js | 56 ++++++++++++++ ...ame-from-assignment-expression-coalesce.js | 56 ++++++++++++++ ...-from-assignment-expression-logical-and.js | 56 ++++++++++++++ ...e-from-assignment-expression-logical-or.js | 56 ++++++++++++++ ...me-from-async-arrow-function-expression.js | 53 +++++++++++++ ...ty-name-from-condition-expression-false.js | 53 +++++++++++++ ...rty-name-from-condition-expression-true.js | 53 +++++++++++++ ...-name-from-decimal-e-notational-literal.js | 53 +++++++++++++ ...uted-property-name-from-decimal-literal.js | 53 +++++++++++++ ...erty-name-from-exponetiation-expression.js | 53 +++++++++++++ ...-property-name-from-expression-coalesce.js | 56 ++++++++++++++ ...operty-name-from-expression-logical-and.js | 56 ++++++++++++++ ...roperty-name-from-expression-logical-or.js | 56 ++++++++++++++ ...property-name-from-function-declaration.js | 54 +++++++++++++ ...-property-name-from-function-expression.js | 53 +++++++++++++ ...ame-from-generator-function-declaration.js | 54 +++++++++++++ ...-computed-property-name-from-identifier.js | 55 +++++++++++++ ...-name-from-integer-e-notational-literal.js | 53 +++++++++++++ ...d-property-name-from-integer-separators.js | 53 +++++++++++++ ...fields-computed-property-name-from-math.js | 53 +++++++++++++ ...name-from-multiplicative-expression-div.js | 53 +++++++++++++ ...ame-from-multiplicative-expression-mult.js | 53 +++++++++++++ ...uted-property-name-from-numeric-literal.js | 53 +++++++++++++ ...puted-property-name-from-string-literal.js | 53 +++++++++++++ ...ted-property-name-from-yield-expression.js | 53 +++++++++++++ ...perty-name-from-additive-expression-add.js | 57 ++++++++++++++ ...-name-from-additive-expression-subtract.js | 57 ++++++++++++++ ...rty-name-from-arrow-function-expression.js | 57 ++++++++++++++ ...e-from-assignment-expression-assignment.js | 60 +++++++++++++++ ...e-from-assignment-expression-bitwise-or.js | 60 +++++++++++++++ ...ame-from-assignment-expression-coalesce.js | 60 +++++++++++++++ ...-from-assignment-expression-logical-and.js | 60 +++++++++++++++ ...e-from-assignment-expression-logical-or.js | 60 +++++++++++++++ ...me-from-async-arrow-function-expression.js | 57 ++++++++++++++ ...ty-name-from-condition-expression-false.js | 57 ++++++++++++++ ...rty-name-from-condition-expression-true.js | 57 ++++++++++++++ ...-name-from-decimal-e-notational-literal.js | 57 ++++++++++++++ ...uted-property-name-from-decimal-literal.js | 57 ++++++++++++++ ...erty-name-from-exponetiation-expression.js | 57 ++++++++++++++ ...-property-name-from-expression-coalesce.js | 60 +++++++++++++++ ...operty-name-from-expression-logical-and.js | 60 +++++++++++++++ ...roperty-name-from-expression-logical-or.js | 60 +++++++++++++++ ...property-name-from-function-declaration.js | 58 ++++++++++++++ ...-property-name-from-function-expression.js | 57 ++++++++++++++ ...ame-from-generator-function-declaration.js | 58 ++++++++++++++ ...-computed-property-name-from-identifier.js | 59 ++++++++++++++ ...-name-from-integer-e-notational-literal.js | 57 ++++++++++++++ ...d-property-name-from-integer-separators.js | 57 ++++++++++++++ ...ethods-computed-property-name-from-math.js | 57 ++++++++++++++ ...name-from-multiplicative-expression-div.js | 57 ++++++++++++++ ...ame-from-multiplicative-expression-mult.js | 57 ++++++++++++++ ...uted-property-name-from-numeric-literal.js | 57 ++++++++++++++ ...puted-property-name-from-string-literal.js | 57 ++++++++++++++ ...ted-property-name-from-yield-expression.js | 57 ++++++++++++++ 261 files changed, 15158 insertions(+) create mode 100644 test/language/expressions/class/cpn-accessors-computed-property-name-from-additive-expression-add.js create mode 100644 test/language/expressions/class/cpn-accessors-computed-property-name-from-additive-expression-subtract.js create mode 100644 test/language/expressions/class/cpn-accessors-computed-property-name-from-arrow-function-expression.js create mode 100644 test/language/expressions/class/cpn-accessors-computed-property-name-from-assignment-expression-assignment.js create mode 100644 test/language/expressions/class/cpn-accessors-computed-property-name-from-assignment-expression-bitwise-or.js create mode 100644 test/language/expressions/class/cpn-accessors-computed-property-name-from-assignment-expression-coalesce.js create mode 100644 test/language/expressions/class/cpn-accessors-computed-property-name-from-assignment-expression-logical-and.js create mode 100644 test/language/expressions/class/cpn-accessors-computed-property-name-from-assignment-expression-logical-or.js create mode 100644 test/language/expressions/class/cpn-accessors-computed-property-name-from-async-arrow-function-expression.js create mode 100644 test/language/expressions/class/cpn-accessors-computed-property-name-from-condition-expression-false.js create mode 100644 test/language/expressions/class/cpn-accessors-computed-property-name-from-condition-expression-true.js create mode 100644 test/language/expressions/class/cpn-accessors-computed-property-name-from-decimal-e-notational-literal.js create mode 100644 test/language/expressions/class/cpn-accessors-computed-property-name-from-decimal-literal.js create mode 100644 test/language/expressions/class/cpn-accessors-computed-property-name-from-exponetiation-expression.js create mode 100644 test/language/expressions/class/cpn-accessors-computed-property-name-from-expression-coalesce.js create mode 100644 test/language/expressions/class/cpn-accessors-computed-property-name-from-expression-logical-and.js create mode 100644 test/language/expressions/class/cpn-accessors-computed-property-name-from-expression-logical-or.js create mode 100644 test/language/expressions/class/cpn-accessors-computed-property-name-from-function-declaration.js create mode 100644 test/language/expressions/class/cpn-accessors-computed-property-name-from-function-expression.js create mode 100644 test/language/expressions/class/cpn-accessors-computed-property-name-from-generator-function-declaration.js create mode 100644 test/language/expressions/class/cpn-accessors-computed-property-name-from-identifier.js create mode 100644 test/language/expressions/class/cpn-accessors-computed-property-name-from-integer-e-notational-literal.js create mode 100644 test/language/expressions/class/cpn-accessors-computed-property-name-from-integer-separators.js create mode 100644 test/language/expressions/class/cpn-accessors-computed-property-name-from-math.js create mode 100644 test/language/expressions/class/cpn-accessors-computed-property-name-from-multiplicative-expression-div.js create mode 100644 test/language/expressions/class/cpn-accessors-computed-property-name-from-multiplicative-expression-mult.js create mode 100644 test/language/expressions/class/cpn-accessors-computed-property-name-from-numeric-literal.js create mode 100644 test/language/expressions/class/cpn-accessors-computed-property-name-from-string-literal.js create mode 100644 test/language/expressions/class/cpn-accessors-computed-property-name-from-yield-expression.js create mode 100644 test/language/expressions/class/cpn-computed-property-name-from-additive-expression-add.js create mode 100644 test/language/expressions/class/cpn-computed-property-name-from-additive-expression-subtract.js create mode 100644 test/language/expressions/class/cpn-computed-property-name-from-arrow-function-expression.js create mode 100644 test/language/expressions/class/cpn-computed-property-name-from-assignment-expression-assignment.js create mode 100644 test/language/expressions/class/cpn-computed-property-name-from-assignment-expression-bitwise-or.js create mode 100644 test/language/expressions/class/cpn-computed-property-name-from-assignment-expression-coalesce.js create mode 100644 test/language/expressions/class/cpn-computed-property-name-from-assignment-expression-logical-and.js create mode 100644 test/language/expressions/class/cpn-computed-property-name-from-assignment-expression-logical-or.js create mode 100644 test/language/expressions/class/cpn-computed-property-name-from-async-arrow-function-expression.js create mode 100644 test/language/expressions/class/cpn-computed-property-name-from-condition-expression-false.js create mode 100644 test/language/expressions/class/cpn-computed-property-name-from-condition-expression-true.js create mode 100644 test/language/expressions/class/cpn-computed-property-name-from-decimal-e-notational-literal.js create mode 100644 test/language/expressions/class/cpn-computed-property-name-from-decimal-literal.js create mode 100644 test/language/expressions/class/cpn-computed-property-name-from-exponetiation-expression.js create mode 100644 test/language/expressions/class/cpn-computed-property-name-from-expression-coalesce.js create mode 100644 test/language/expressions/class/cpn-computed-property-name-from-expression-logical-and.js create mode 100644 test/language/expressions/class/cpn-computed-property-name-from-expression-logical-or.js create mode 100644 test/language/expressions/class/cpn-computed-property-name-from-function-declaration.js create mode 100644 test/language/expressions/class/cpn-computed-property-name-from-function-expression.js create mode 100644 test/language/expressions/class/cpn-computed-property-name-from-generator-function-declaration.js create mode 100644 test/language/expressions/class/cpn-computed-property-name-from-identifier.js create mode 100644 test/language/expressions/class/cpn-computed-property-name-from-integer-e-notational-literal.js create mode 100644 test/language/expressions/class/cpn-computed-property-name-from-integer-separators.js create mode 100644 test/language/expressions/class/cpn-computed-property-name-from-math.js create mode 100644 test/language/expressions/class/cpn-computed-property-name-from-multiplicative-expression-div.js create mode 100644 test/language/expressions/class/cpn-computed-property-name-from-multiplicative-expression-mult.js create mode 100644 test/language/expressions/class/cpn-computed-property-name-from-numeric-literal.js create mode 100644 test/language/expressions/class/cpn-computed-property-name-from-string-literal.js create mode 100644 test/language/expressions/class/cpn-computed-property-name-from-yield-expression.js create mode 100644 test/language/expressions/class/cpn-fields-computed-property-name-from-additive-expression-add.js create mode 100644 test/language/expressions/class/cpn-fields-computed-property-name-from-additive-expression-subtract.js create mode 100644 test/language/expressions/class/cpn-fields-computed-property-name-from-arrow-function-expression.js create mode 100644 test/language/expressions/class/cpn-fields-computed-property-name-from-assignment-expression-assignment.js create mode 100644 test/language/expressions/class/cpn-fields-computed-property-name-from-assignment-expression-bitwise-or.js create mode 100644 test/language/expressions/class/cpn-fields-computed-property-name-from-assignment-expression-coalesce.js create mode 100644 test/language/expressions/class/cpn-fields-computed-property-name-from-assignment-expression-logical-and.js create mode 100644 test/language/expressions/class/cpn-fields-computed-property-name-from-assignment-expression-logical-or.js create mode 100644 test/language/expressions/class/cpn-fields-computed-property-name-from-async-arrow-function-expression.js create mode 100644 test/language/expressions/class/cpn-fields-computed-property-name-from-condition-expression-false.js create mode 100644 test/language/expressions/class/cpn-fields-computed-property-name-from-condition-expression-true.js create mode 100644 test/language/expressions/class/cpn-fields-computed-property-name-from-decimal-e-notational-literal.js create mode 100644 test/language/expressions/class/cpn-fields-computed-property-name-from-decimal-literal.js create mode 100644 test/language/expressions/class/cpn-fields-computed-property-name-from-exponetiation-expression.js create mode 100644 test/language/expressions/class/cpn-fields-computed-property-name-from-expression-coalesce.js create mode 100644 test/language/expressions/class/cpn-fields-computed-property-name-from-expression-logical-and.js create mode 100644 test/language/expressions/class/cpn-fields-computed-property-name-from-expression-logical-or.js create mode 100644 test/language/expressions/class/cpn-fields-computed-property-name-from-function-declaration.js create mode 100644 test/language/expressions/class/cpn-fields-computed-property-name-from-function-expression.js create mode 100644 test/language/expressions/class/cpn-fields-computed-property-name-from-generator-function-declaration.js create mode 100644 test/language/expressions/class/cpn-fields-computed-property-name-from-identifier.js create mode 100644 test/language/expressions/class/cpn-fields-computed-property-name-from-integer-e-notational-literal.js create mode 100644 test/language/expressions/class/cpn-fields-computed-property-name-from-integer-separators.js create mode 100644 test/language/expressions/class/cpn-fields-computed-property-name-from-math.js create mode 100644 test/language/expressions/class/cpn-fields-computed-property-name-from-multiplicative-expression-div.js create mode 100644 test/language/expressions/class/cpn-fields-computed-property-name-from-multiplicative-expression-mult.js create mode 100644 test/language/expressions/class/cpn-fields-computed-property-name-from-numeric-literal.js create mode 100644 test/language/expressions/class/cpn-fields-computed-property-name-from-string-literal.js create mode 100644 test/language/expressions/class/cpn-fields-computed-property-name-from-yield-expression.js create mode 100644 test/language/expressions/class/cpn-fields-methods-computed-property-name-from-additive-expression-add.js create mode 100644 test/language/expressions/class/cpn-fields-methods-computed-property-name-from-additive-expression-subtract.js create mode 100644 test/language/expressions/class/cpn-fields-methods-computed-property-name-from-arrow-function-expression.js create mode 100644 test/language/expressions/class/cpn-fields-methods-computed-property-name-from-assignment-expression-assignment.js create mode 100644 test/language/expressions/class/cpn-fields-methods-computed-property-name-from-assignment-expression-bitwise-or.js create mode 100644 test/language/expressions/class/cpn-fields-methods-computed-property-name-from-assignment-expression-coalesce.js create mode 100644 test/language/expressions/class/cpn-fields-methods-computed-property-name-from-assignment-expression-logical-and.js create mode 100644 test/language/expressions/class/cpn-fields-methods-computed-property-name-from-assignment-expression-logical-or.js create mode 100644 test/language/expressions/class/cpn-fields-methods-computed-property-name-from-async-arrow-function-expression.js create mode 100644 test/language/expressions/class/cpn-fields-methods-computed-property-name-from-condition-expression-false.js create mode 100644 test/language/expressions/class/cpn-fields-methods-computed-property-name-from-condition-expression-true.js create mode 100644 test/language/expressions/class/cpn-fields-methods-computed-property-name-from-decimal-e-notational-literal.js create mode 100644 test/language/expressions/class/cpn-fields-methods-computed-property-name-from-decimal-literal.js create mode 100644 test/language/expressions/class/cpn-fields-methods-computed-property-name-from-exponetiation-expression.js create mode 100644 test/language/expressions/class/cpn-fields-methods-computed-property-name-from-expression-coalesce.js create mode 100644 test/language/expressions/class/cpn-fields-methods-computed-property-name-from-expression-logical-and.js create mode 100644 test/language/expressions/class/cpn-fields-methods-computed-property-name-from-expression-logical-or.js create mode 100644 test/language/expressions/class/cpn-fields-methods-computed-property-name-from-function-declaration.js create mode 100644 test/language/expressions/class/cpn-fields-methods-computed-property-name-from-function-expression.js create mode 100644 test/language/expressions/class/cpn-fields-methods-computed-property-name-from-generator-function-declaration.js create mode 100644 test/language/expressions/class/cpn-fields-methods-computed-property-name-from-identifier.js create mode 100644 test/language/expressions/class/cpn-fields-methods-computed-property-name-from-integer-e-notational-literal.js create mode 100644 test/language/expressions/class/cpn-fields-methods-computed-property-name-from-integer-separators.js create mode 100644 test/language/expressions/class/cpn-fields-methods-computed-property-name-from-math.js create mode 100644 test/language/expressions/class/cpn-fields-methods-computed-property-name-from-multiplicative-expression-div.js create mode 100644 test/language/expressions/class/cpn-fields-methods-computed-property-name-from-multiplicative-expression-mult.js create mode 100644 test/language/expressions/class/cpn-fields-methods-computed-property-name-from-numeric-literal.js create mode 100644 test/language/expressions/class/cpn-fields-methods-computed-property-name-from-string-literal.js create mode 100644 test/language/expressions/class/cpn-fields-methods-computed-property-name-from-yield-expression.js create mode 100644 test/language/expressions/object/cpn-computed-property-name-from-additive-expression-add.js create mode 100644 test/language/expressions/object/cpn-computed-property-name-from-additive-expression-subtract.js create mode 100644 test/language/expressions/object/cpn-computed-property-name-from-arrow-function-expression.js create mode 100644 test/language/expressions/object/cpn-computed-property-name-from-assignment-expression-assignment.js create mode 100644 test/language/expressions/object/cpn-computed-property-name-from-assignment-expression-bitwise-or.js create mode 100644 test/language/expressions/object/cpn-computed-property-name-from-assignment-expression-coalesce.js create mode 100644 test/language/expressions/object/cpn-computed-property-name-from-assignment-expression-logical-and.js create mode 100644 test/language/expressions/object/cpn-computed-property-name-from-assignment-expression-logical-or.js create mode 100644 test/language/expressions/object/cpn-computed-property-name-from-async-arrow-function-expression.js create mode 100644 test/language/expressions/object/cpn-computed-property-name-from-condition-expression-false.js create mode 100644 test/language/expressions/object/cpn-computed-property-name-from-condition-expression-true.js create mode 100644 test/language/expressions/object/cpn-computed-property-name-from-decimal-e-notational-literal.js create mode 100644 test/language/expressions/object/cpn-computed-property-name-from-decimal-literal.js create mode 100644 test/language/expressions/object/cpn-computed-property-name-from-exponetiation-expression.js create mode 100644 test/language/expressions/object/cpn-computed-property-name-from-expression-coalesce.js create mode 100644 test/language/expressions/object/cpn-computed-property-name-from-expression-logical-and.js create mode 100644 test/language/expressions/object/cpn-computed-property-name-from-expression-logical-or.js create mode 100644 test/language/expressions/object/cpn-computed-property-name-from-function-declaration.js create mode 100644 test/language/expressions/object/cpn-computed-property-name-from-function-expression.js create mode 100644 test/language/expressions/object/cpn-computed-property-name-from-generator-function-declaration.js create mode 100644 test/language/expressions/object/cpn-computed-property-name-from-identifier.js create mode 100644 test/language/expressions/object/cpn-computed-property-name-from-integer-e-notational-literal.js create mode 100644 test/language/expressions/object/cpn-computed-property-name-from-integer-separators.js create mode 100644 test/language/expressions/object/cpn-computed-property-name-from-math.js create mode 100644 test/language/expressions/object/cpn-computed-property-name-from-multiplicative-expression-div.js create mode 100644 test/language/expressions/object/cpn-computed-property-name-from-multiplicative-expression-mult.js create mode 100644 test/language/expressions/object/cpn-computed-property-name-from-numeric-literal.js create mode 100644 test/language/expressions/object/cpn-computed-property-name-from-string-literal.js create mode 100644 test/language/expressions/object/cpn-computed-property-name-from-yield-expression.js create mode 100644 test/language/statements/class/cpn-accessors-computed-property-name-from-additive-expression-add.js create mode 100644 test/language/statements/class/cpn-accessors-computed-property-name-from-additive-expression-subtract.js create mode 100644 test/language/statements/class/cpn-accessors-computed-property-name-from-arrow-function-expression.js create mode 100644 test/language/statements/class/cpn-accessors-computed-property-name-from-assignment-expression-assignment.js create mode 100644 test/language/statements/class/cpn-accessors-computed-property-name-from-assignment-expression-bitwise-or.js create mode 100644 test/language/statements/class/cpn-accessors-computed-property-name-from-assignment-expression-coalesce.js create mode 100644 test/language/statements/class/cpn-accessors-computed-property-name-from-assignment-expression-logical-and.js create mode 100644 test/language/statements/class/cpn-accessors-computed-property-name-from-assignment-expression-logical-or.js create mode 100644 test/language/statements/class/cpn-accessors-computed-property-name-from-async-arrow-function-expression.js create mode 100644 test/language/statements/class/cpn-accessors-computed-property-name-from-condition-expression-false.js create mode 100644 test/language/statements/class/cpn-accessors-computed-property-name-from-condition-expression-true.js create mode 100644 test/language/statements/class/cpn-accessors-computed-property-name-from-decimal-e-notational-literal.js create mode 100644 test/language/statements/class/cpn-accessors-computed-property-name-from-decimal-literal.js create mode 100644 test/language/statements/class/cpn-accessors-computed-property-name-from-exponetiation-expression.js create mode 100644 test/language/statements/class/cpn-accessors-computed-property-name-from-expression-coalesce.js create mode 100644 test/language/statements/class/cpn-accessors-computed-property-name-from-expression-logical-and.js create mode 100644 test/language/statements/class/cpn-accessors-computed-property-name-from-expression-logical-or.js create mode 100644 test/language/statements/class/cpn-accessors-computed-property-name-from-function-declaration.js create mode 100644 test/language/statements/class/cpn-accessors-computed-property-name-from-function-expression.js create mode 100644 test/language/statements/class/cpn-accessors-computed-property-name-from-generator-function-declaration.js create mode 100644 test/language/statements/class/cpn-accessors-computed-property-name-from-identifier.js create mode 100644 test/language/statements/class/cpn-accessors-computed-property-name-from-integer-e-notational-literal.js create mode 100644 test/language/statements/class/cpn-accessors-computed-property-name-from-integer-separators.js create mode 100644 test/language/statements/class/cpn-accessors-computed-property-name-from-math.js create mode 100644 test/language/statements/class/cpn-accessors-computed-property-name-from-multiplicative-expression-div.js create mode 100644 test/language/statements/class/cpn-accessors-computed-property-name-from-multiplicative-expression-mult.js create mode 100644 test/language/statements/class/cpn-accessors-computed-property-name-from-numeric-literal.js create mode 100644 test/language/statements/class/cpn-accessors-computed-property-name-from-string-literal.js create mode 100644 test/language/statements/class/cpn-accessors-computed-property-name-from-yield-expression.js create mode 100644 test/language/statements/class/cpn-computed-property-name-from-additive-expression-add.js create mode 100644 test/language/statements/class/cpn-computed-property-name-from-additive-expression-subtract.js create mode 100644 test/language/statements/class/cpn-computed-property-name-from-arrow-function-expression.js create mode 100644 test/language/statements/class/cpn-computed-property-name-from-assignment-expression-assignment.js create mode 100644 test/language/statements/class/cpn-computed-property-name-from-assignment-expression-bitwise-or.js create mode 100644 test/language/statements/class/cpn-computed-property-name-from-assignment-expression-coalesce.js create mode 100644 test/language/statements/class/cpn-computed-property-name-from-assignment-expression-logical-and.js create mode 100644 test/language/statements/class/cpn-computed-property-name-from-assignment-expression-logical-or.js create mode 100644 test/language/statements/class/cpn-computed-property-name-from-async-arrow-function-expression.js create mode 100644 test/language/statements/class/cpn-computed-property-name-from-condition-expression-false.js create mode 100644 test/language/statements/class/cpn-computed-property-name-from-condition-expression-true.js create mode 100644 test/language/statements/class/cpn-computed-property-name-from-decimal-e-notational-literal.js create mode 100644 test/language/statements/class/cpn-computed-property-name-from-decimal-literal.js create mode 100644 test/language/statements/class/cpn-computed-property-name-from-exponetiation-expression.js create mode 100644 test/language/statements/class/cpn-computed-property-name-from-expression-coalesce.js create mode 100644 test/language/statements/class/cpn-computed-property-name-from-expression-logical-and.js create mode 100644 test/language/statements/class/cpn-computed-property-name-from-expression-logical-or.js create mode 100644 test/language/statements/class/cpn-computed-property-name-from-function-declaration.js create mode 100644 test/language/statements/class/cpn-computed-property-name-from-function-expression.js create mode 100644 test/language/statements/class/cpn-computed-property-name-from-generator-function-declaration.js create mode 100644 test/language/statements/class/cpn-computed-property-name-from-identifier.js create mode 100644 test/language/statements/class/cpn-computed-property-name-from-integer-e-notational-literal.js create mode 100644 test/language/statements/class/cpn-computed-property-name-from-integer-separators.js create mode 100644 test/language/statements/class/cpn-computed-property-name-from-math.js create mode 100644 test/language/statements/class/cpn-computed-property-name-from-multiplicative-expression-div.js create mode 100644 test/language/statements/class/cpn-computed-property-name-from-multiplicative-expression-mult.js create mode 100644 test/language/statements/class/cpn-computed-property-name-from-numeric-literal.js create mode 100644 test/language/statements/class/cpn-computed-property-name-from-string-literal.js create mode 100644 test/language/statements/class/cpn-computed-property-name-from-yield-expression.js create mode 100644 test/language/statements/class/cpn-fields-computed-property-name-from-additive-expression-add.js create mode 100644 test/language/statements/class/cpn-fields-computed-property-name-from-additive-expression-subtract.js create mode 100644 test/language/statements/class/cpn-fields-computed-property-name-from-arrow-function-expression.js create mode 100644 test/language/statements/class/cpn-fields-computed-property-name-from-assignment-expression-assignment.js create mode 100644 test/language/statements/class/cpn-fields-computed-property-name-from-assignment-expression-bitwise-or.js create mode 100644 test/language/statements/class/cpn-fields-computed-property-name-from-assignment-expression-coalesce.js create mode 100644 test/language/statements/class/cpn-fields-computed-property-name-from-assignment-expression-logical-and.js create mode 100644 test/language/statements/class/cpn-fields-computed-property-name-from-assignment-expression-logical-or.js create mode 100644 test/language/statements/class/cpn-fields-computed-property-name-from-async-arrow-function-expression.js create mode 100644 test/language/statements/class/cpn-fields-computed-property-name-from-condition-expression-false.js create mode 100644 test/language/statements/class/cpn-fields-computed-property-name-from-condition-expression-true.js create mode 100644 test/language/statements/class/cpn-fields-computed-property-name-from-decimal-e-notational-literal.js create mode 100644 test/language/statements/class/cpn-fields-computed-property-name-from-decimal-literal.js create mode 100644 test/language/statements/class/cpn-fields-computed-property-name-from-exponetiation-expression.js create mode 100644 test/language/statements/class/cpn-fields-computed-property-name-from-expression-coalesce.js create mode 100644 test/language/statements/class/cpn-fields-computed-property-name-from-expression-logical-and.js create mode 100644 test/language/statements/class/cpn-fields-computed-property-name-from-expression-logical-or.js create mode 100644 test/language/statements/class/cpn-fields-computed-property-name-from-function-declaration.js create mode 100644 test/language/statements/class/cpn-fields-computed-property-name-from-function-expression.js create mode 100644 test/language/statements/class/cpn-fields-computed-property-name-from-generator-function-declaration.js create mode 100644 test/language/statements/class/cpn-fields-computed-property-name-from-identifier.js create mode 100644 test/language/statements/class/cpn-fields-computed-property-name-from-integer-e-notational-literal.js create mode 100644 test/language/statements/class/cpn-fields-computed-property-name-from-integer-separators.js create mode 100644 test/language/statements/class/cpn-fields-computed-property-name-from-math.js create mode 100644 test/language/statements/class/cpn-fields-computed-property-name-from-multiplicative-expression-div.js create mode 100644 test/language/statements/class/cpn-fields-computed-property-name-from-multiplicative-expression-mult.js create mode 100644 test/language/statements/class/cpn-fields-computed-property-name-from-numeric-literal.js create mode 100644 test/language/statements/class/cpn-fields-computed-property-name-from-string-literal.js create mode 100644 test/language/statements/class/cpn-fields-computed-property-name-from-yield-expression.js create mode 100644 test/language/statements/class/cpn-fields-methods-computed-property-name-from-additive-expression-add.js create mode 100644 test/language/statements/class/cpn-fields-methods-computed-property-name-from-additive-expression-subtract.js create mode 100644 test/language/statements/class/cpn-fields-methods-computed-property-name-from-arrow-function-expression.js create mode 100644 test/language/statements/class/cpn-fields-methods-computed-property-name-from-assignment-expression-assignment.js create mode 100644 test/language/statements/class/cpn-fields-methods-computed-property-name-from-assignment-expression-bitwise-or.js create mode 100644 test/language/statements/class/cpn-fields-methods-computed-property-name-from-assignment-expression-coalesce.js create mode 100644 test/language/statements/class/cpn-fields-methods-computed-property-name-from-assignment-expression-logical-and.js create mode 100644 test/language/statements/class/cpn-fields-methods-computed-property-name-from-assignment-expression-logical-or.js create mode 100644 test/language/statements/class/cpn-fields-methods-computed-property-name-from-async-arrow-function-expression.js create mode 100644 test/language/statements/class/cpn-fields-methods-computed-property-name-from-condition-expression-false.js create mode 100644 test/language/statements/class/cpn-fields-methods-computed-property-name-from-condition-expression-true.js create mode 100644 test/language/statements/class/cpn-fields-methods-computed-property-name-from-decimal-e-notational-literal.js create mode 100644 test/language/statements/class/cpn-fields-methods-computed-property-name-from-decimal-literal.js create mode 100644 test/language/statements/class/cpn-fields-methods-computed-property-name-from-exponetiation-expression.js create mode 100644 test/language/statements/class/cpn-fields-methods-computed-property-name-from-expression-coalesce.js create mode 100644 test/language/statements/class/cpn-fields-methods-computed-property-name-from-expression-logical-and.js create mode 100644 test/language/statements/class/cpn-fields-methods-computed-property-name-from-expression-logical-or.js create mode 100644 test/language/statements/class/cpn-fields-methods-computed-property-name-from-function-declaration.js create mode 100644 test/language/statements/class/cpn-fields-methods-computed-property-name-from-function-expression.js create mode 100644 test/language/statements/class/cpn-fields-methods-computed-property-name-from-generator-function-declaration.js create mode 100644 test/language/statements/class/cpn-fields-methods-computed-property-name-from-identifier.js create mode 100644 test/language/statements/class/cpn-fields-methods-computed-property-name-from-integer-e-notational-literal.js create mode 100644 test/language/statements/class/cpn-fields-methods-computed-property-name-from-integer-separators.js create mode 100644 test/language/statements/class/cpn-fields-methods-computed-property-name-from-math.js create mode 100644 test/language/statements/class/cpn-fields-methods-computed-property-name-from-multiplicative-expression-div.js create mode 100644 test/language/statements/class/cpn-fields-methods-computed-property-name-from-multiplicative-expression-mult.js create mode 100644 test/language/statements/class/cpn-fields-methods-computed-property-name-from-numeric-literal.js create mode 100644 test/language/statements/class/cpn-fields-methods-computed-property-name-from-string-literal.js create mode 100644 test/language/statements/class/cpn-fields-methods-computed-property-name-from-yield-expression.js diff --git a/test/language/expressions/class/cpn-accessors-computed-property-name-from-additive-expression-add.js b/test/language/expressions/class/cpn-accessors-computed-property-name-from-additive-expression-add.js new file mode 100644 index 0000000000..449c554383 --- /dev/null +++ b/test/language/expressions/class/cpn-accessors-computed-property-name-from-additive-expression-add.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-additive-expression-add.case +// - src/computed-property-names/evaluation/class-expression-accessors.template +/*--- +description: Computed property name from additive expression "add" (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 [1 + 1]() { + return 2; + } + + set [1 + 1](v) { + return 2; + } + + static get [1 + 1]() { + return 2; + } + + static set [1 + 1](v) { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[1 + 1], + 2 +); +assert.sameValue( + c[1 + 1] = 2, + 2 +); + +assert.sameValue( + C[1 + 1], + 2 +); +assert.sameValue( + C[1 + 1] = 2, + 2 +); diff --git a/test/language/expressions/class/cpn-accessors-computed-property-name-from-additive-expression-subtract.js b/test/language/expressions/class/cpn-accessors-computed-property-name-from-additive-expression-subtract.js new file mode 100644 index 0000000000..22fb8654c8 --- /dev/null +++ b/test/language/expressions/class/cpn-accessors-computed-property-name-from-additive-expression-subtract.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-additive-expression-subtract.case +// - src/computed-property-names/evaluation/class-expression-accessors.template +/*--- +description: Computed property name from additive expression "subtract" (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 [1 - 1]() { + return 0; + } + + set [1 - 1](v) { + return 0; + } + + static get [1 - 1]() { + return 0; + } + + static set [1 - 1](v) { + return 0; + } +}; + +let c = new C(); + +assert.sameValue( + c[1 - 1], + 0 +); +assert.sameValue( + c[1 - 1] = 0, + 0 +); + +assert.sameValue( + C[1 - 1], + 0 +); +assert.sameValue( + C[1 - 1] = 0, + 0 +); diff --git a/test/language/expressions/class/cpn-accessors-computed-property-name-from-arrow-function-expression.js b/test/language/expressions/class/cpn-accessors-computed-property-name-from-arrow-function-expression.js new file mode 100644 index 0000000000..096377ace9 --- /dev/null +++ b/test/language/expressions/class/cpn-accessors-computed-property-name-from-arrow-function-expression.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-arrow-function-expression.case +// - src/computed-property-names/evaluation/class-expression-accessors.template +/*--- +description: Computed property name from arrow function (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 [() => { }]() { + return 1; + } + + set [() => { }](v) { + return 1; + } + + static get [() => { }]() { + return 1; + } + + static set [() => { }](v) { + return 1; + } +}; + +let c = new C(); + +assert.sameValue( + c[() => { }], + 1 +); +assert.sameValue( + c[() => { }] = 1, + 1 +); + +assert.sameValue( + C[() => { }], + 1 +); +assert.sameValue( + C[() => { }] = 1, + 1 +); diff --git a/test/language/expressions/class/cpn-accessors-computed-property-name-from-assignment-expression-assignment.js b/test/language/expressions/class/cpn-accessors-computed-property-name-from-assignment-expression-assignment.js new file mode 100644 index 0000000000..d90589d76a --- /dev/null +++ b/test/language/expressions/class/cpn-accessors-computed-property-name-from-assignment-expression-assignment.js @@ -0,0 +1,77 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-assignment.case +// - src/computed-property-names/evaluation/class-expression-accessors.template +/*--- +description: Computed property name from assignment expression (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +let C = class { + get [x = 1]() { + return 2; + } + + set [x = 1](v) { + return 2; + } + + static get [x = 1]() { + return 2; + } + + static set [x = 1](v) { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[x = 1], + 2 +); +assert.sameValue( + c[x = 1] = 2, + 2 +); + +assert.sameValue( + C[x = 1], + 2 +); +assert.sameValue( + C[x = 1] = 2, + 2 +); + +assert.sameValue(x, 1); diff --git a/test/language/expressions/class/cpn-accessors-computed-property-name-from-assignment-expression-bitwise-or.js b/test/language/expressions/class/cpn-accessors-computed-property-name-from-assignment-expression-bitwise-or.js new file mode 100644 index 0000000000..85e29f4dc3 --- /dev/null +++ b/test/language/expressions/class/cpn-accessors-computed-property-name-from-assignment-expression-bitwise-or.js @@ -0,0 +1,77 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-bitwise-or.case +// - src/computed-property-names/evaluation/class-expression-accessors.template +/*--- +description: Computed property name from assignment expression bitwise or (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +let C = class { + get [x |= 1]() { + return 2; + } + + set [x |= 1](v) { + return 2; + } + + static get [x |= 1]() { + return 2; + } + + static set [x |= 1](v) { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[x |= 1], + 2 +); +assert.sameValue( + c[x |= 1] = 2, + 2 +); + +assert.sameValue( + C[x |= 1], + 2 +); +assert.sameValue( + C[x |= 1] = 2, + 2 +); + +assert.sameValue(x, 1); diff --git a/test/language/expressions/class/cpn-accessors-computed-property-name-from-assignment-expression-coalesce.js b/test/language/expressions/class/cpn-accessors-computed-property-name-from-assignment-expression-coalesce.js new file mode 100644 index 0000000000..da941cb36a --- /dev/null +++ b/test/language/expressions/class/cpn-accessors-computed-property-name-from-assignment-expression-coalesce.js @@ -0,0 +1,77 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-coalesce.case +// - src/computed-property-names/evaluation/class-expression-accessors.template +/*--- +description: Computed property name from assignment expression coalesce (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = null; + + +let C = class { + get [x ??= 1]() { + return 2; + } + + set [x ??= 1](v) { + return 2; + } + + static get [x ??= 1]() { + return 2; + } + + static set [x ??= 1](v) { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[x ??= 1], + 2 +); +assert.sameValue( + c[x ??= 1] = 2, + 2 +); + +assert.sameValue( + C[x ??= 1], + 2 +); +assert.sameValue( + C[x ??= 1] = 2, + 2 +); + +assert.sameValue(x, 1); diff --git a/test/language/expressions/class/cpn-accessors-computed-property-name-from-assignment-expression-logical-and.js b/test/language/expressions/class/cpn-accessors-computed-property-name-from-assignment-expression-logical-and.js new file mode 100644 index 0000000000..33d90bcb10 --- /dev/null +++ b/test/language/expressions/class/cpn-accessors-computed-property-name-from-assignment-expression-logical-and.js @@ -0,0 +1,77 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-logical-and.case +// - src/computed-property-names/evaluation/class-expression-accessors.template +/*--- +description: Computed property name from assignment expression logical and (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +let C = class { + get [x &&= 1]() { + return 2; + } + + set [x &&= 1](v) { + return 2; + } + + static get [x &&= 1]() { + return 2; + } + + static set [x &&= 1](v) { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[x &&= 1], + 2 +); +assert.sameValue( + c[x &&= 1] = 2, + 2 +); + +assert.sameValue( + C[x &&= 1], + 2 +); +assert.sameValue( + C[x &&= 1] = 2, + 2 +); + +assert.sameValue(x, 0); diff --git a/test/language/expressions/class/cpn-accessors-computed-property-name-from-assignment-expression-logical-or.js b/test/language/expressions/class/cpn-accessors-computed-property-name-from-assignment-expression-logical-or.js new file mode 100644 index 0000000000..eeff6f91d8 --- /dev/null +++ b/test/language/expressions/class/cpn-accessors-computed-property-name-from-assignment-expression-logical-or.js @@ -0,0 +1,77 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-logical-or.case +// - src/computed-property-names/evaluation/class-expression-accessors.template +/*--- +description: Computed property name from assignment expression logical or (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +let C = class { + get [x ||= 1]() { + return 2; + } + + set [x ||= 1](v) { + return 2; + } + + static get [x ||= 1]() { + return 2; + } + + static set [x ||= 1](v) { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[x ||= 1], + 2 +); +assert.sameValue( + c[x ||= 1] = 2, + 2 +); + +assert.sameValue( + C[x ||= 1], + 2 +); +assert.sameValue( + C[x ||= 1] = 2, + 2 +); + +assert.sameValue(x, 1); diff --git a/test/language/expressions/class/cpn-accessors-computed-property-name-from-async-arrow-function-expression.js b/test/language/expressions/class/cpn-accessors-computed-property-name-from-async-arrow-function-expression.js new file mode 100644 index 0000000000..c18810b54f --- /dev/null +++ b/test/language/expressions/class/cpn-accessors-computed-property-name-from-async-arrow-function-expression.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-async-arrow-function-expression.case +// - src/computed-property-names/evaluation/class-expression-accessors.template +/*--- +description: Computed property name from function expression (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 [async () => {}]() { + return 1; + } + + set [async () => {}](v) { + return 1; + } + + static get [async () => {}]() { + return 1; + } + + static set [async () => {}](v) { + return 1; + } +}; + +let c = new C(); + +assert.sameValue( + c[async () => {}], + 1 +); +assert.sameValue( + c[async () => {}] = 1, + 1 +); + +assert.sameValue( + C[async () => {}], + 1 +); +assert.sameValue( + C[async () => {}] = 1, + 1 +); diff --git a/test/language/expressions/class/cpn-accessors-computed-property-name-from-condition-expression-false.js b/test/language/expressions/class/cpn-accessors-computed-property-name-from-condition-expression-false.js new file mode 100644 index 0000000000..d070a08908 --- /dev/null +++ b/test/language/expressions/class/cpn-accessors-computed-property-name-from-condition-expression-false.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-condition-expression-false.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] +flags: [generated] +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 [false ? 1 : 2]() { + return 1; + } + + set [false ? 1 : 2](v) { + return 1; + } + + static get [false ? 1 : 2]() { + return 1; + } + + static set [false ? 1 : 2](v) { + return 1; + } +}; + +let c = new C(); + +assert.sameValue( + c[false ? 1 : 2], + 1 +); +assert.sameValue( + c[false ? 1 : 2] = 1, + 1 +); + +assert.sameValue( + C[false ? 1 : 2], + 1 +); +assert.sameValue( + C[false ? 1 : 2] = 1, + 1 +); diff --git a/test/language/expressions/class/cpn-accessors-computed-property-name-from-condition-expression-true.js b/test/language/expressions/class/cpn-accessors-computed-property-name-from-condition-expression-true.js new file mode 100644 index 0000000000..6411e95183 --- /dev/null +++ b/test/language/expressions/class/cpn-accessors-computed-property-name-from-condition-expression-true.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-condition-expression-true.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] +flags: [generated] +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 [true ? 1 : 2]() { + return 2; + } + + set [true ? 1 : 2](v) { + return 2; + } + + static get [true ? 1 : 2]() { + return 2; + } + + static set [true ? 1 : 2](v) { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[true ? 1 : 2], + 2 +); +assert.sameValue( + c[true ? 1 : 2] = 2, + 2 +); + +assert.sameValue( + C[true ? 1 : 2], + 2 +); +assert.sameValue( + C[true ? 1 : 2] = 2, + 2 +); diff --git a/test/language/expressions/class/cpn-accessors-computed-property-name-from-decimal-e-notational-literal.js b/test/language/expressions/class/cpn-accessors-computed-property-name-from-decimal-e-notational-literal.js new file mode 100644 index 0000000000..283150ee29 --- /dev/null +++ b/test/language/expressions/class/cpn-accessors-computed-property-name-from-decimal-e-notational-literal.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-decimal-e-notational-literal.case +// - src/computed-property-names/evaluation/class-expression-accessors.template +/*--- +description: Computed property name from decimal e notational literal (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 [1.e1]() { + return 2; + } + + set [1.e1](v) { + return 2; + } + + static get [1.e1]() { + return 2; + } + + static set [1.e1](v) { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[1.e1], + 2 +); +assert.sameValue( + c[1.e1] = 2, + 2 +); + +assert.sameValue( + C[1.e1], + 2 +); +assert.sameValue( + C[1.e1] = 2, + 2 +); diff --git a/test/language/expressions/class/cpn-accessors-computed-property-name-from-decimal-literal.js b/test/language/expressions/class/cpn-accessors-computed-property-name-from-decimal-literal.js new file mode 100644 index 0000000000..25e3ab030a --- /dev/null +++ b/test/language/expressions/class/cpn-accessors-computed-property-name-from-decimal-literal.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-decimal-literal.case +// - src/computed-property-names/evaluation/class-expression-accessors.template +/*--- +description: Computed property name from decimal literal (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 [1.1]() { + return 2; + } + + set [1.1](v) { + return 2; + } + + static get [1.1]() { + return 2; + } + + static set [1.1](v) { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[1.1], + 2 +); +assert.sameValue( + c[1.1] = 2, + 2 +); + +assert.sameValue( + C[1.1], + 2 +); +assert.sameValue( + C[1.1] = 2, + 2 +); diff --git a/test/language/expressions/class/cpn-accessors-computed-property-name-from-exponetiation-expression.js b/test/language/expressions/class/cpn-accessors-computed-property-name-from-exponetiation-expression.js new file mode 100644 index 0000000000..08106a13fb --- /dev/null +++ b/test/language/expressions/class/cpn-accessors-computed-property-name-from-exponetiation-expression.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-exponetiation-expression.case +// - src/computed-property-names/evaluation/class-expression-accessors.template +/*--- +description: Computed property name from exponentiation expression (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 [2 ** 2]() { + return 4; + } + + set [2 ** 2](v) { + return 4; + } + + static get [2 ** 2]() { + return 4; + } + + static set [2 ** 2](v) { + return 4; + } +}; + +let c = new C(); + +assert.sameValue( + c[2 ** 2], + 4 +); +assert.sameValue( + c[2 ** 2] = 4, + 4 +); + +assert.sameValue( + C[2 ** 2], + 4 +); +assert.sameValue( + C[2 ** 2] = 4, + 4 +); diff --git a/test/language/expressions/class/cpn-accessors-computed-property-name-from-expression-coalesce.js b/test/language/expressions/class/cpn-accessors-computed-property-name-from-expression-coalesce.js new file mode 100644 index 0000000000..ce59833f8f --- /dev/null +++ b/test/language/expressions/class/cpn-accessors-computed-property-name-from-expression-coalesce.js @@ -0,0 +1,77 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-expression-coalesce.case +// - src/computed-property-names/evaluation/class-expression-accessors.template +/*--- +description: Computed property name from coalesce (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x; + + +let C = class { + get [x ?? 1]() { + return 2; + } + + set [x ?? 1](v) { + return 2; + } + + static get [x ?? 1]() { + return 2; + } + + static set [x ?? 1](v) { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[x ?? 1], + 2 +); +assert.sameValue( + c[x ?? 1] = 2, + 2 +); + +assert.sameValue( + C[x ?? 1], + 2 +); +assert.sameValue( + C[x ?? 1] = 2, + 2 +); + +assert.sameValue(x, undefined); diff --git a/test/language/expressions/class/cpn-accessors-computed-property-name-from-expression-logical-and.js b/test/language/expressions/class/cpn-accessors-computed-property-name-from-expression-logical-and.js new file mode 100644 index 0000000000..d3b0884c52 --- /dev/null +++ b/test/language/expressions/class/cpn-accessors-computed-property-name-from-expression-logical-and.js @@ -0,0 +1,77 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-expression-logical-and.case +// - src/computed-property-names/evaluation/class-expression-accessors.template +/*--- +description: Computed property name from logical and (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +let C = class { + get [x && 1]() { + return 2; + } + + set [x && 1](v) { + return 2; + } + + static get [x && 1]() { + return 2; + } + + static set [x && 1](v) { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[x && 1], + 2 +); +assert.sameValue( + c[x && 1] = 2, + 2 +); + +assert.sameValue( + C[x && 1], + 2 +); +assert.sameValue( + C[x && 1] = 2, + 2 +); + +assert.sameValue(x, 0); diff --git a/test/language/expressions/class/cpn-accessors-computed-property-name-from-expression-logical-or.js b/test/language/expressions/class/cpn-accessors-computed-property-name-from-expression-logical-or.js new file mode 100644 index 0000000000..135c449323 --- /dev/null +++ b/test/language/expressions/class/cpn-accessors-computed-property-name-from-expression-logical-or.js @@ -0,0 +1,77 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-expression-logical-or.case +// - src/computed-property-names/evaluation/class-expression-accessors.template +/*--- +description: Computed property name from logical or (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +let C = class { + get [x || 1]() { + return 2; + } + + set [x || 1](v) { + return 2; + } + + static get [x || 1]() { + return 2; + } + + static set [x || 1](v) { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[x || 1], + 2 +); +assert.sameValue( + c[x || 1] = 2, + 2 +); + +assert.sameValue( + C[x || 1], + 2 +); +assert.sameValue( + C[x || 1] = 2, + 2 +); + +assert.sameValue(x, 0); diff --git a/test/language/expressions/class/cpn-accessors-computed-property-name-from-function-declaration.js b/test/language/expressions/class/cpn-accessors-computed-property-name-from-function-declaration.js new file mode 100644 index 0000000000..6bcf6c5e12 --- /dev/null +++ b/test/language/expressions/class/cpn-accessors-computed-property-name-from-function-declaration.js @@ -0,0 +1,75 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-function-declaration.case +// - src/computed-property-names/evaluation/class-expression-accessors.template +/*--- +description: Computed property name from function (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 ] +---*/ +function f() {} + + +let C = class { + get [f()]() { + return 1; + } + + set [f()](v) { + return 1; + } + + static get [f()]() { + return 1; + } + + static set [f()](v) { + return 1; + } +}; + +let c = new C(); + +assert.sameValue( + c[f()], + 1 +); +assert.sameValue( + c[f()] = 1, + 1 +); + +assert.sameValue( + C[f()], + 1 +); +assert.sameValue( + C[f()] = 1, + 1 +); diff --git a/test/language/expressions/class/cpn-accessors-computed-property-name-from-function-expression.js b/test/language/expressions/class/cpn-accessors-computed-property-name-from-function-expression.js new file mode 100644 index 0000000000..71fc6d4701 --- /dev/null +++ b/test/language/expressions/class/cpn-accessors-computed-property-name-from-function-expression.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-function-expression.case +// - src/computed-property-names/evaluation/class-expression-accessors.template +/*--- +description: Computed property name from function expression (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 [function () {}]() { + return 1; + } + + set [function () {}](v) { + return 1; + } + + static get [function () {}]() { + return 1; + } + + static set [function () {}](v) { + return 1; + } +}; + +let c = new C(); + +assert.sameValue( + c[function () {}], + 1 +); +assert.sameValue( + c[function () {}] = 1, + 1 +); + +assert.sameValue( + C[function () {}], + 1 +); +assert.sameValue( + C[function () {}] = 1, + 1 +); diff --git a/test/language/expressions/class/cpn-accessors-computed-property-name-from-generator-function-declaration.js b/test/language/expressions/class/cpn-accessors-computed-property-name-from-generator-function-declaration.js new file mode 100644 index 0000000000..8ff9b06470 --- /dev/null +++ b/test/language/expressions/class/cpn-accessors-computed-property-name-from-generator-function-declaration.js @@ -0,0 +1,75 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-generator-function-declaration.case +// - src/computed-property-names/evaluation/class-expression-accessors.template +/*--- +description: Computed property name from generator function (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 ] +---*/ +function * g() { return 1; } + + +let C = class { + get [g()]() { + return 1; + } + + set [g()](v) { + return 1; + } + + static get [g()]() { + return 1; + } + + static set [g()](v) { + return 1; + } +}; + +let c = new C(); + +assert.sameValue( + c[g()], + 1 +); +assert.sameValue( + c[g()] = 1, + 1 +); + +assert.sameValue( + C[g()], + 1 +); +assert.sameValue( + C[g()] = 1, + 1 +); diff --git a/test/language/expressions/class/cpn-accessors-computed-property-name-from-identifier.js b/test/language/expressions/class/cpn-accessors-computed-property-name-from-identifier.js new file mode 100644 index 0000000000..cc02b1b70c --- /dev/null +++ b/test/language/expressions/class/cpn-accessors-computed-property-name-from-identifier.js @@ -0,0 +1,76 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-identifier.case +// - src/computed-property-names/evaluation/class-expression-accessors.template +/*--- +description: Computed property name from string literal (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 1; + + + +let C = class { + get [x]() { + return '2'; + } + + set [x](v) { + return '2'; + } + + static get [x]() { + return '2'; + } + + static set [x](v) { + return '2'; + } +}; + +let c = new C(); + +assert.sameValue( + c[x], + '2' +); +assert.sameValue( + c[x] = '2', + '2' +); + +assert.sameValue( + C[x], + '2' +); +assert.sameValue( + C[x] = '2', + '2' +); diff --git a/test/language/expressions/class/cpn-accessors-computed-property-name-from-integer-e-notational-literal.js b/test/language/expressions/class/cpn-accessors-computed-property-name-from-integer-e-notational-literal.js new file mode 100644 index 0000000000..eca13103c7 --- /dev/null +++ b/test/language/expressions/class/cpn-accessors-computed-property-name-from-integer-e-notational-literal.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-integer-e-notational-literal.case +// - src/computed-property-names/evaluation/class-expression-accessors.template +/*--- +description: Computed property name from numeric literal (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 [1]() { + return 2; + } + + set [1](v) { + return 2; + } + + static get [1]() { + return 2; + } + + static set [1](v) { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[1], + 2 +); +assert.sameValue( + c[1] = 2, + 2 +); + +assert.sameValue( + C[1], + 2 +); +assert.sameValue( + C[1] = 2, + 2 +); diff --git a/test/language/expressions/class/cpn-accessors-computed-property-name-from-integer-separators.js b/test/language/expressions/class/cpn-accessors-computed-property-name-from-integer-separators.js new file mode 100644 index 0000000000..9bc9cb7aa8 --- /dev/null +++ b/test/language/expressions/class/cpn-accessors-computed-property-name-from-integer-separators.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-integer-separators.case +// - src/computed-property-names/evaluation/class-expression-accessors.template +/*--- +description: Computed property name from integer with separators (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 [1_2_3_4_5_6_7_8]() { + return 1_2_3_4_5_6_7_8; + } + + set [1_2_3_4_5_6_7_8](v) { + return 1_2_3_4_5_6_7_8; + } + + static get [1_2_3_4_5_6_7_8]() { + return 1_2_3_4_5_6_7_8; + } + + static set [1_2_3_4_5_6_7_8](v) { + return 1_2_3_4_5_6_7_8; + } +}; + +let c = new C(); + +assert.sameValue( + c[1_2_3_4_5_6_7_8], + 1_2_3_4_5_6_7_8 +); +assert.sameValue( + c[1_2_3_4_5_6_7_8] = 1_2_3_4_5_6_7_8, + 1_2_3_4_5_6_7_8 +); + +assert.sameValue( + C[1_2_3_4_5_6_7_8], + 1_2_3_4_5_6_7_8 +); +assert.sameValue( + C[1_2_3_4_5_6_7_8] = 1_2_3_4_5_6_7_8, + 1_2_3_4_5_6_7_8 +); diff --git a/test/language/expressions/class/cpn-accessors-computed-property-name-from-math.js b/test/language/expressions/class/cpn-accessors-computed-property-name-from-math.js new file mode 100644 index 0000000000..43164fa2ae --- /dev/null +++ b/test/language/expressions/class/cpn-accessors-computed-property-name-from-math.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-math.case +// - src/computed-property-names/evaluation/class-expression-accessors.template +/*--- +description: Computed property name from math (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 [1 + 2 - 3 * 4 / 5 ** 6]() { + return 2.999232; + } + + set [1 + 2 - 3 * 4 / 5 ** 6](v) { + return 2.999232; + } + + static get [1 + 2 - 3 * 4 / 5 ** 6]() { + return 2.999232; + } + + static set [1 + 2 - 3 * 4 / 5 ** 6](v) { + return 2.999232; + } +}; + +let c = new C(); + +assert.sameValue( + c[1 + 2 - 3 * 4 / 5 ** 6], + 2.999232 +); +assert.sameValue( + c[1 + 2 - 3 * 4 / 5 ** 6] = 2.999232, + 2.999232 +); + +assert.sameValue( + C[1 + 2 - 3 * 4 / 5 ** 6], + 2.999232 +); +assert.sameValue( + C[1 + 2 - 3 * 4 / 5 ** 6] = 2.999232, + 2.999232 +); diff --git a/test/language/expressions/class/cpn-accessors-computed-property-name-from-multiplicative-expression-div.js b/test/language/expressions/class/cpn-accessors-computed-property-name-from-multiplicative-expression-div.js new file mode 100644 index 0000000000..d54c34108d --- /dev/null +++ b/test/language/expressions/class/cpn-accessors-computed-property-name-from-multiplicative-expression-div.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-multiplicative-expression-div.case +// - src/computed-property-names/evaluation/class-expression-accessors.template +/*--- +description: Computed property name from multiplicative expression "divide" (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 [1 / 1]() { + return 1; + } + + set [1 / 1](v) { + return 1; + } + + static get [1 / 1]() { + return 1; + } + + static set [1 / 1](v) { + return 1; + } +}; + +let c = new C(); + +assert.sameValue( + c[1 / 1], + 1 +); +assert.sameValue( + c[1 / 1] = 1, + 1 +); + +assert.sameValue( + C[1 / 1], + 1 +); +assert.sameValue( + C[1 / 1] = 1, + 1 +); diff --git a/test/language/expressions/class/cpn-accessors-computed-property-name-from-multiplicative-expression-mult.js b/test/language/expressions/class/cpn-accessors-computed-property-name-from-multiplicative-expression-mult.js new file mode 100644 index 0000000000..7aba212325 --- /dev/null +++ b/test/language/expressions/class/cpn-accessors-computed-property-name-from-multiplicative-expression-mult.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-multiplicative-expression-mult.case +// - src/computed-property-names/evaluation/class-expression-accessors.template +/*--- +description: Computed property name from multiplicative expression "multiply" (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 [1 * 1]() { + return 1; + } + + set [1 * 1](v) { + return 1; + } + + static get [1 * 1]() { + return 1; + } + + static set [1 * 1](v) { + return 1; + } +}; + +let c = new C(); + +assert.sameValue( + c[1 * 1], + 1 +); +assert.sameValue( + c[1 * 1] = 1, + 1 +); + +assert.sameValue( + C[1 * 1], + 1 +); +assert.sameValue( + C[1 * 1] = 1, + 1 +); diff --git a/test/language/expressions/class/cpn-accessors-computed-property-name-from-numeric-literal.js b/test/language/expressions/class/cpn-accessors-computed-property-name-from-numeric-literal.js new file mode 100644 index 0000000000..182891ec78 --- /dev/null +++ b/test/language/expressions/class/cpn-accessors-computed-property-name-from-numeric-literal.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-numeric-literal.case +// - src/computed-property-names/evaluation/class-expression-accessors.template +/*--- +description: Computed property name from numeric literal (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 [1]() { + return 2; + } + + set [1](v) { + return 2; + } + + static get [1]() { + return 2; + } + + static set [1](v) { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[1], + 2 +); +assert.sameValue( + c[1] = 2, + 2 +); + +assert.sameValue( + C[1], + 2 +); +assert.sameValue( + C[1] = 2, + 2 +); diff --git a/test/language/expressions/class/cpn-accessors-computed-property-name-from-string-literal.js b/test/language/expressions/class/cpn-accessors-computed-property-name-from-string-literal.js new file mode 100644 index 0000000000..dd516b2fb0 --- /dev/null +++ b/test/language/expressions/class/cpn-accessors-computed-property-name-from-string-literal.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-string-literal.case +// - src/computed-property-names/evaluation/class-expression-accessors.template +/*--- +description: Computed property name from string literal (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 ['1']() { + return '2'; + } + + set ['1'](v) { + return '2'; + } + + static get ['1']() { + return '2'; + } + + static set ['1'](v) { + return '2'; + } +}; + +let c = new C(); + +assert.sameValue( + c['1'], + '2' +); +assert.sameValue( + c['1'] = '2', + '2' +); + +assert.sameValue( + C['1'], + '2' +); +assert.sameValue( + C['1'] = '2', + '2' +); diff --git a/test/language/expressions/class/cpn-accessors-computed-property-name-from-yield-expression.js b/test/language/expressions/class/cpn-accessors-computed-property-name-from-yield-expression.js new file mode 100644 index 0000000000..78cca449eb --- /dev/null +++ b/test/language/expressions/class/cpn-accessors-computed-property-name-from-yield-expression.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-yield-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] +flags: [generated] +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 [true ? 1 : 2]() { + return 2; + } + + set [true ? 1 : 2](v) { + return 2; + } + + static get [true ? 1 : 2]() { + return 2; + } + + static set [true ? 1 : 2](v) { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[true ? 1 : 2], + 2 +); +assert.sameValue( + c[true ? 1 : 2] = 2, + 2 +); + +assert.sameValue( + C[true ? 1 : 2], + 2 +); +assert.sameValue( + C[true ? 1 : 2] = 2, + 2 +); diff --git a/test/language/expressions/class/cpn-computed-property-name-from-additive-expression-add.js b/test/language/expressions/class/cpn-computed-property-name-from-additive-expression-add.js new file mode 100644 index 0000000000..94b1b47a40 --- /dev/null +++ b/test/language/expressions/class/cpn-computed-property-name-from-additive-expression-add.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-additive-expression-add.case +// - src/computed-property-names/evaluation/class-expression.template +/*--- +description: Computed property name from additive expression "add" (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1 + 1]() { + return 2; + } + static [1 + 1]() { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[1 + 1](), + 2 +); +assert.sameValue( + C[1 + 1](), + 2 +); diff --git a/test/language/expressions/class/cpn-computed-property-name-from-additive-expression-subtract.js b/test/language/expressions/class/cpn-computed-property-name-from-additive-expression-subtract.js new file mode 100644 index 0000000000..6530f40987 --- /dev/null +++ b/test/language/expressions/class/cpn-computed-property-name-from-additive-expression-subtract.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-additive-expression-subtract.case +// - src/computed-property-names/evaluation/class-expression.template +/*--- +description: Computed property name from additive expression "subtract" (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1 - 1]() { + return 0; + } + static [1 - 1]() { + return 0; + } +}; + +let c = new C(); + +assert.sameValue( + c[1 - 1](), + 0 +); +assert.sameValue( + C[1 - 1](), + 0 +); diff --git a/test/language/expressions/class/cpn-computed-property-name-from-arrow-function-expression.js b/test/language/expressions/class/cpn-computed-property-name-from-arrow-function-expression.js new file mode 100644 index 0000000000..82fdc44961 --- /dev/null +++ b/test/language/expressions/class/cpn-computed-property-name-from-arrow-function-expression.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-arrow-function-expression.case +// - src/computed-property-names/evaluation/class-expression.template +/*--- +description: Computed property name from arrow function (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [() => { }]() { + return 1; + } + static [() => { }]() { + return 1; + } +}; + +let c = new C(); + +assert.sameValue( + c[() => { }](), + 1 +); +assert.sameValue( + C[() => { }](), + 1 +); diff --git a/test/language/expressions/class/cpn-computed-property-name-from-assignment-expression-assignment.js b/test/language/expressions/class/cpn-computed-property-name-from-assignment-expression-assignment.js new file mode 100644 index 0000000000..c3af76fef7 --- /dev/null +++ b/test/language/expressions/class/cpn-computed-property-name-from-assignment-expression-assignment.js @@ -0,0 +1,59 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-assignment.case +// - src/computed-property-names/evaluation/class-expression.template +/*--- +description: Computed property name from assignment expression (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +let C = class { + [x = 1]() { + return 2; + } + static [x = 1]() { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[x = 1](), + 2 +); +assert.sameValue( + C[x = 1](), + 2 +); + +assert.sameValue(x, 1); diff --git a/test/language/expressions/class/cpn-computed-property-name-from-assignment-expression-bitwise-or.js b/test/language/expressions/class/cpn-computed-property-name-from-assignment-expression-bitwise-or.js new file mode 100644 index 0000000000..8127810ada --- /dev/null +++ b/test/language/expressions/class/cpn-computed-property-name-from-assignment-expression-bitwise-or.js @@ -0,0 +1,59 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-bitwise-or.case +// - src/computed-property-names/evaluation/class-expression.template +/*--- +description: Computed property name from assignment expression bitwise or (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +let C = class { + [x |= 1]() { + return 2; + } + static [x |= 1]() { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[x |= 1](), + 2 +); +assert.sameValue( + C[x |= 1](), + 2 +); + +assert.sameValue(x, 1); diff --git a/test/language/expressions/class/cpn-computed-property-name-from-assignment-expression-coalesce.js b/test/language/expressions/class/cpn-computed-property-name-from-assignment-expression-coalesce.js new file mode 100644 index 0000000000..c5cca0003b --- /dev/null +++ b/test/language/expressions/class/cpn-computed-property-name-from-assignment-expression-coalesce.js @@ -0,0 +1,59 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-coalesce.case +// - src/computed-property-names/evaluation/class-expression.template +/*--- +description: Computed property name from assignment expression coalesce (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = null; + + +let C = class { + [x ??= 1]() { + return 2; + } + static [x ??= 1]() { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[x ??= 1](), + 2 +); +assert.sameValue( + C[x ??= 1](), + 2 +); + +assert.sameValue(x, 1); diff --git a/test/language/expressions/class/cpn-computed-property-name-from-assignment-expression-logical-and.js b/test/language/expressions/class/cpn-computed-property-name-from-assignment-expression-logical-and.js new file mode 100644 index 0000000000..cd294b064a --- /dev/null +++ b/test/language/expressions/class/cpn-computed-property-name-from-assignment-expression-logical-and.js @@ -0,0 +1,59 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-logical-and.case +// - src/computed-property-names/evaluation/class-expression.template +/*--- +description: Computed property name from assignment expression logical and (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +let C = class { + [x &&= 1]() { + return 2; + } + static [x &&= 1]() { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[x &&= 1](), + 2 +); +assert.sameValue( + C[x &&= 1](), + 2 +); + +assert.sameValue(x, 0); diff --git a/test/language/expressions/class/cpn-computed-property-name-from-assignment-expression-logical-or.js b/test/language/expressions/class/cpn-computed-property-name-from-assignment-expression-logical-or.js new file mode 100644 index 0000000000..68ab416d4b --- /dev/null +++ b/test/language/expressions/class/cpn-computed-property-name-from-assignment-expression-logical-or.js @@ -0,0 +1,59 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-logical-or.case +// - src/computed-property-names/evaluation/class-expression.template +/*--- +description: Computed property name from assignment expression logical or (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +let C = class { + [x ||= 1]() { + return 2; + } + static [x ||= 1]() { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[x ||= 1](), + 2 +); +assert.sameValue( + C[x ||= 1](), + 2 +); + +assert.sameValue(x, 1); diff --git a/test/language/expressions/class/cpn-computed-property-name-from-async-arrow-function-expression.js b/test/language/expressions/class/cpn-computed-property-name-from-async-arrow-function-expression.js new file mode 100644 index 0000000000..3b6dd30f48 --- /dev/null +++ b/test/language/expressions/class/cpn-computed-property-name-from-async-arrow-function-expression.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-async-arrow-function-expression.case +// - src/computed-property-names/evaluation/class-expression.template +/*--- +description: Computed property name from function expression (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [async () => {}]() { + return 1; + } + static [async () => {}]() { + return 1; + } +}; + +let c = new C(); + +assert.sameValue( + c[async () => {}](), + 1 +); +assert.sameValue( + C[async () => {}](), + 1 +); diff --git a/test/language/expressions/class/cpn-computed-property-name-from-condition-expression-false.js b/test/language/expressions/class/cpn-computed-property-name-from-condition-expression-false.js new file mode 100644 index 0000000000..45362848bf --- /dev/null +++ b/test/language/expressions/class/cpn-computed-property-name-from-condition-expression-false.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-condition-expression-false.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] +flags: [generated] +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 { + [false ? 1 : 2]() { + return 1; + } + static [false ? 1 : 2]() { + return 1; + } +}; + +let c = new C(); + +assert.sameValue( + c[false ? 1 : 2](), + 1 +); +assert.sameValue( + C[false ? 1 : 2](), + 1 +); diff --git a/test/language/expressions/class/cpn-computed-property-name-from-condition-expression-true.js b/test/language/expressions/class/cpn-computed-property-name-from-condition-expression-true.js new file mode 100644 index 0000000000..ead782435c --- /dev/null +++ b/test/language/expressions/class/cpn-computed-property-name-from-condition-expression-true.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-condition-expression-true.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] +flags: [generated] +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 { + [true ? 1 : 2]() { + return 2; + } + static [true ? 1 : 2]() { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[true ? 1 : 2](), + 2 +); +assert.sameValue( + C[true ? 1 : 2](), + 2 +); diff --git a/test/language/expressions/class/cpn-computed-property-name-from-decimal-e-notational-literal.js b/test/language/expressions/class/cpn-computed-property-name-from-decimal-e-notational-literal.js new file mode 100644 index 0000000000..07a2ef35e0 --- /dev/null +++ b/test/language/expressions/class/cpn-computed-property-name-from-decimal-e-notational-literal.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-decimal-e-notational-literal.case +// - src/computed-property-names/evaluation/class-expression.template +/*--- +description: Computed property name from decimal e notational literal (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1.e1]() { + return 2; + } + static [1.e1]() { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[1.e1](), + 2 +); +assert.sameValue( + C[1.e1](), + 2 +); diff --git a/test/language/expressions/class/cpn-computed-property-name-from-decimal-literal.js b/test/language/expressions/class/cpn-computed-property-name-from-decimal-literal.js new file mode 100644 index 0000000000..cfdef37aeb --- /dev/null +++ b/test/language/expressions/class/cpn-computed-property-name-from-decimal-literal.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-decimal-literal.case +// - src/computed-property-names/evaluation/class-expression.template +/*--- +description: Computed property name from decimal literal (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1.1]() { + return 2; + } + static [1.1]() { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[1.1](), + 2 +); +assert.sameValue( + C[1.1](), + 2 +); diff --git a/test/language/expressions/class/cpn-computed-property-name-from-exponetiation-expression.js b/test/language/expressions/class/cpn-computed-property-name-from-exponetiation-expression.js new file mode 100644 index 0000000000..002b66f6c1 --- /dev/null +++ b/test/language/expressions/class/cpn-computed-property-name-from-exponetiation-expression.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-exponetiation-expression.case +// - src/computed-property-names/evaluation/class-expression.template +/*--- +description: Computed property name from exponentiation expression (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [2 ** 2]() { + return 4; + } + static [2 ** 2]() { + return 4; + } +}; + +let c = new C(); + +assert.sameValue( + c[2 ** 2](), + 4 +); +assert.sameValue( + C[2 ** 2](), + 4 +); diff --git a/test/language/expressions/class/cpn-computed-property-name-from-expression-coalesce.js b/test/language/expressions/class/cpn-computed-property-name-from-expression-coalesce.js new file mode 100644 index 0000000000..b77d700db5 --- /dev/null +++ b/test/language/expressions/class/cpn-computed-property-name-from-expression-coalesce.js @@ -0,0 +1,59 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-expression-coalesce.case +// - src/computed-property-names/evaluation/class-expression.template +/*--- +description: Computed property name from coalesce (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x; + + +let C = class { + [x ?? 1]() { + return 2; + } + static [x ?? 1]() { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[x ?? 1](), + 2 +); +assert.sameValue( + C[x ?? 1](), + 2 +); + +assert.sameValue(x, undefined); diff --git a/test/language/expressions/class/cpn-computed-property-name-from-expression-logical-and.js b/test/language/expressions/class/cpn-computed-property-name-from-expression-logical-and.js new file mode 100644 index 0000000000..059a89c35f --- /dev/null +++ b/test/language/expressions/class/cpn-computed-property-name-from-expression-logical-and.js @@ -0,0 +1,59 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-expression-logical-and.case +// - src/computed-property-names/evaluation/class-expression.template +/*--- +description: Computed property name from logical and (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +let C = class { + [x && 1]() { + return 2; + } + static [x && 1]() { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[x && 1](), + 2 +); +assert.sameValue( + C[x && 1](), + 2 +); + +assert.sameValue(x, 0); diff --git a/test/language/expressions/class/cpn-computed-property-name-from-expression-logical-or.js b/test/language/expressions/class/cpn-computed-property-name-from-expression-logical-or.js new file mode 100644 index 0000000000..4bdf00dc8b --- /dev/null +++ b/test/language/expressions/class/cpn-computed-property-name-from-expression-logical-or.js @@ -0,0 +1,59 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-expression-logical-or.case +// - src/computed-property-names/evaluation/class-expression.template +/*--- +description: Computed property name from logical or (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +let C = class { + [x || 1]() { + return 2; + } + static [x || 1]() { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[x || 1](), + 2 +); +assert.sameValue( + C[x || 1](), + 2 +); + +assert.sameValue(x, 0); diff --git a/test/language/expressions/class/cpn-computed-property-name-from-function-declaration.js b/test/language/expressions/class/cpn-computed-property-name-from-function-declaration.js new file mode 100644 index 0000000000..b46921a733 --- /dev/null +++ b/test/language/expressions/class/cpn-computed-property-name-from-function-declaration.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-function-declaration.case +// - src/computed-property-names/evaluation/class-expression.template +/*--- +description: Computed property name from function (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 ] +---*/ +function f() {} + + +let C = class { + [f()]() { + return 1; + } + static [f()]() { + return 1; + } +}; + +let c = new C(); + +assert.sameValue( + c[f()](), + 1 +); +assert.sameValue( + C[f()](), + 1 +); diff --git a/test/language/expressions/class/cpn-computed-property-name-from-function-expression.js b/test/language/expressions/class/cpn-computed-property-name-from-function-expression.js new file mode 100644 index 0000000000..99393a7b77 --- /dev/null +++ b/test/language/expressions/class/cpn-computed-property-name-from-function-expression.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-function-expression.case +// - src/computed-property-names/evaluation/class-expression.template +/*--- +description: Computed property name from function expression (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [function () {}]() { + return 1; + } + static [function () {}]() { + return 1; + } +}; + +let c = new C(); + +assert.sameValue( + c[function () {}](), + 1 +); +assert.sameValue( + C[function () {}](), + 1 +); diff --git a/test/language/expressions/class/cpn-computed-property-name-from-generator-function-declaration.js b/test/language/expressions/class/cpn-computed-property-name-from-generator-function-declaration.js new file mode 100644 index 0000000000..7874908496 --- /dev/null +++ b/test/language/expressions/class/cpn-computed-property-name-from-generator-function-declaration.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-generator-function-declaration.case +// - src/computed-property-names/evaluation/class-expression.template +/*--- +description: Computed property name from generator function (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 ] +---*/ +function * g() { return 1; } + + +let C = class { + [g()]() { + return 1; + } + static [g()]() { + return 1; + } +}; + +let c = new C(); + +assert.sameValue( + c[g()](), + 1 +); +assert.sameValue( + C[g()](), + 1 +); diff --git a/test/language/expressions/class/cpn-computed-property-name-from-identifier.js b/test/language/expressions/class/cpn-computed-property-name-from-identifier.js new file mode 100644 index 0000000000..2b9ac0db8e --- /dev/null +++ b/test/language/expressions/class/cpn-computed-property-name-from-identifier.js @@ -0,0 +1,58 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-identifier.case +// - src/computed-property-names/evaluation/class-expression.template +/*--- +description: Computed property name from string literal (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 1; + + + +let C = class { + [x]() { + return '2'; + } + static [x]() { + return '2'; + } +}; + +let c = new C(); + +assert.sameValue( + c[x](), + '2' +); +assert.sameValue( + C[x](), + '2' +); diff --git a/test/language/expressions/class/cpn-computed-property-name-from-integer-e-notational-literal.js b/test/language/expressions/class/cpn-computed-property-name-from-integer-e-notational-literal.js new file mode 100644 index 0000000000..2f0dc37b6c --- /dev/null +++ b/test/language/expressions/class/cpn-computed-property-name-from-integer-e-notational-literal.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-integer-e-notational-literal.case +// - src/computed-property-names/evaluation/class-expression.template +/*--- +description: Computed property name from numeric literal (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1]() { + return 2; + } + static [1]() { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[1](), + 2 +); +assert.sameValue( + C[1](), + 2 +); diff --git a/test/language/expressions/class/cpn-computed-property-name-from-integer-separators.js b/test/language/expressions/class/cpn-computed-property-name-from-integer-separators.js new file mode 100644 index 0000000000..6711c9e35c --- /dev/null +++ b/test/language/expressions/class/cpn-computed-property-name-from-integer-separators.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-integer-separators.case +// - src/computed-property-names/evaluation/class-expression.template +/*--- +description: Computed property name from integer with separators (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1_2_3_4_5_6_7_8]() { + return 1_2_3_4_5_6_7_8; + } + static [1_2_3_4_5_6_7_8]() { + return 1_2_3_4_5_6_7_8; + } +}; + +let c = new C(); + +assert.sameValue( + c[1_2_3_4_5_6_7_8](), + 1_2_3_4_5_6_7_8 +); +assert.sameValue( + C[1_2_3_4_5_6_7_8](), + 1_2_3_4_5_6_7_8 +); diff --git a/test/language/expressions/class/cpn-computed-property-name-from-math.js b/test/language/expressions/class/cpn-computed-property-name-from-math.js new file mode 100644 index 0000000000..0ed258dba3 --- /dev/null +++ b/test/language/expressions/class/cpn-computed-property-name-from-math.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-math.case +// - src/computed-property-names/evaluation/class-expression.template +/*--- +description: Computed property name from math (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1 + 2 - 3 * 4 / 5 ** 6]() { + return 2.999232; + } + static [1 + 2 - 3 * 4 / 5 ** 6]() { + return 2.999232; + } +}; + +let c = new C(); + +assert.sameValue( + c[1 + 2 - 3 * 4 / 5 ** 6](), + 2.999232 +); +assert.sameValue( + C[1 + 2 - 3 * 4 / 5 ** 6](), + 2.999232 +); diff --git a/test/language/expressions/class/cpn-computed-property-name-from-multiplicative-expression-div.js b/test/language/expressions/class/cpn-computed-property-name-from-multiplicative-expression-div.js new file mode 100644 index 0000000000..f3701a3a8f --- /dev/null +++ b/test/language/expressions/class/cpn-computed-property-name-from-multiplicative-expression-div.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-multiplicative-expression-div.case +// - src/computed-property-names/evaluation/class-expression.template +/*--- +description: Computed property name from multiplicative expression "divide" (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1 / 1]() { + return 1; + } + static [1 / 1]() { + return 1; + } +}; + +let c = new C(); + +assert.sameValue( + c[1 / 1](), + 1 +); +assert.sameValue( + C[1 / 1](), + 1 +); diff --git a/test/language/expressions/class/cpn-computed-property-name-from-multiplicative-expression-mult.js b/test/language/expressions/class/cpn-computed-property-name-from-multiplicative-expression-mult.js new file mode 100644 index 0000000000..674bdf64c3 --- /dev/null +++ b/test/language/expressions/class/cpn-computed-property-name-from-multiplicative-expression-mult.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-multiplicative-expression-mult.case +// - src/computed-property-names/evaluation/class-expression.template +/*--- +description: Computed property name from multiplicative expression "multiply" (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1 * 1]() { + return 1; + } + static [1 * 1]() { + return 1; + } +}; + +let c = new C(); + +assert.sameValue( + c[1 * 1](), + 1 +); +assert.sameValue( + C[1 * 1](), + 1 +); diff --git a/test/language/expressions/class/cpn-computed-property-name-from-numeric-literal.js b/test/language/expressions/class/cpn-computed-property-name-from-numeric-literal.js new file mode 100644 index 0000000000..3050257e57 --- /dev/null +++ b/test/language/expressions/class/cpn-computed-property-name-from-numeric-literal.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-numeric-literal.case +// - src/computed-property-names/evaluation/class-expression.template +/*--- +description: Computed property name from numeric literal (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1]() { + return 2; + } + static [1]() { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[1](), + 2 +); +assert.sameValue( + C[1](), + 2 +); diff --git a/test/language/expressions/class/cpn-computed-property-name-from-string-literal.js b/test/language/expressions/class/cpn-computed-property-name-from-string-literal.js new file mode 100644 index 0000000000..3432e2aada --- /dev/null +++ b/test/language/expressions/class/cpn-computed-property-name-from-string-literal.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-string-literal.case +// - src/computed-property-names/evaluation/class-expression.template +/*--- +description: Computed property name from string literal (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + ['1']() { + return '2'; + } + static ['1']() { + return '2'; + } +}; + +let c = new C(); + +assert.sameValue( + c['1'](), + '2' +); +assert.sameValue( + C['1'](), + '2' +); diff --git a/test/language/expressions/class/cpn-computed-property-name-from-yield-expression.js b/test/language/expressions/class/cpn-computed-property-name-from-yield-expression.js new file mode 100644 index 0000000000..713b2133d6 --- /dev/null +++ b/test/language/expressions/class/cpn-computed-property-name-from-yield-expression.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-yield-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] +flags: [generated] +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 { + [true ? 1 : 2]() { + return 2; + } + static [true ? 1 : 2]() { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[true ? 1 : 2](), + 2 +); +assert.sameValue( + C[true ? 1 : 2](), + 2 +); diff --git a/test/language/expressions/class/cpn-fields-computed-property-name-from-additive-expression-add.js b/test/language/expressions/class/cpn-fields-computed-property-name-from-additive-expression-add.js new file mode 100644 index 0000000000..b88bda2823 --- /dev/null +++ b/test/language/expressions/class/cpn-fields-computed-property-name-from-additive-expression-add.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-additive-expression-add.case +// - src/computed-property-names/evaluation/class-expression-fields.template +/*--- +description: Computed property name from additive expression "add" (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1 + 1] = 2; + + static [1 + 1] = 2; +}; + +let c = new C(); + +assert.sameValue( + c[1 + 1], + 2 +); +assert.sameValue( + C[1 + 1], + 2 +); diff --git a/test/language/expressions/class/cpn-fields-computed-property-name-from-additive-expression-subtract.js b/test/language/expressions/class/cpn-fields-computed-property-name-from-additive-expression-subtract.js new file mode 100644 index 0000000000..ab59a5cefe --- /dev/null +++ b/test/language/expressions/class/cpn-fields-computed-property-name-from-additive-expression-subtract.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-additive-expression-subtract.case +// - src/computed-property-names/evaluation/class-expression-fields.template +/*--- +description: Computed property name from additive expression "subtract" (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1 - 1] = 0; + + static [1 - 1] = 0; +}; + +let c = new C(); + +assert.sameValue( + c[1 - 1], + 0 +); +assert.sameValue( + C[1 - 1], + 0 +); diff --git a/test/language/expressions/class/cpn-fields-computed-property-name-from-arrow-function-expression.js b/test/language/expressions/class/cpn-fields-computed-property-name-from-arrow-function-expression.js new file mode 100644 index 0000000000..f174fef065 --- /dev/null +++ b/test/language/expressions/class/cpn-fields-computed-property-name-from-arrow-function-expression.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-arrow-function-expression.case +// - src/computed-property-names/evaluation/class-expression-fields.template +/*--- +description: Computed property name from arrow function (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [() => { }] = 1; + + static [() => { }] = 1; +}; + +let c = new C(); + +assert.sameValue( + c[() => { }], + 1 +); +assert.sameValue( + C[() => { }], + 1 +); diff --git a/test/language/expressions/class/cpn-fields-computed-property-name-from-assignment-expression-assignment.js b/test/language/expressions/class/cpn-fields-computed-property-name-from-assignment-expression-assignment.js new file mode 100644 index 0000000000..d5464ac0ec --- /dev/null +++ b/test/language/expressions/class/cpn-fields-computed-property-name-from-assignment-expression-assignment.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-assignment.case +// - src/computed-property-names/evaluation/class-expression-fields.template +/*--- +description: Computed property name from assignment expression (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +let C = class { + [x = 1] = 2; + + static [x = 1] = 2; +}; + +let c = new C(); + +assert.sameValue( + c[x = 1], + 2 +); +assert.sameValue( + C[x = 1], + 2 +); + +assert.sameValue(x, 1); diff --git a/test/language/expressions/class/cpn-fields-computed-property-name-from-assignment-expression-bitwise-or.js b/test/language/expressions/class/cpn-fields-computed-property-name-from-assignment-expression-bitwise-or.js new file mode 100644 index 0000000000..84ddcc3257 --- /dev/null +++ b/test/language/expressions/class/cpn-fields-computed-property-name-from-assignment-expression-bitwise-or.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-bitwise-or.case +// - src/computed-property-names/evaluation/class-expression-fields.template +/*--- +description: Computed property name from assignment expression bitwise or (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +let C = class { + [x |= 1] = 2; + + static [x |= 1] = 2; +}; + +let c = new C(); + +assert.sameValue( + c[x |= 1], + 2 +); +assert.sameValue( + C[x |= 1], + 2 +); + +assert.sameValue(x, 1); diff --git a/test/language/expressions/class/cpn-fields-computed-property-name-from-assignment-expression-coalesce.js b/test/language/expressions/class/cpn-fields-computed-property-name-from-assignment-expression-coalesce.js new file mode 100644 index 0000000000..fc37842f41 --- /dev/null +++ b/test/language/expressions/class/cpn-fields-computed-property-name-from-assignment-expression-coalesce.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-coalesce.case +// - src/computed-property-names/evaluation/class-expression-fields.template +/*--- +description: Computed property name from assignment expression coalesce (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = null; + + +let C = class { + [x ??= 1] = 2; + + static [x ??= 1] = 2; +}; + +let c = new C(); + +assert.sameValue( + c[x ??= 1], + 2 +); +assert.sameValue( + C[x ??= 1], + 2 +); + +assert.sameValue(x, 1); diff --git a/test/language/expressions/class/cpn-fields-computed-property-name-from-assignment-expression-logical-and.js b/test/language/expressions/class/cpn-fields-computed-property-name-from-assignment-expression-logical-and.js new file mode 100644 index 0000000000..54e839577b --- /dev/null +++ b/test/language/expressions/class/cpn-fields-computed-property-name-from-assignment-expression-logical-and.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-logical-and.case +// - src/computed-property-names/evaluation/class-expression-fields.template +/*--- +description: Computed property name from assignment expression logical and (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +let C = class { + [x &&= 1] = 2; + + static [x &&= 1] = 2; +}; + +let c = new C(); + +assert.sameValue( + c[x &&= 1], + 2 +); +assert.sameValue( + C[x &&= 1], + 2 +); + +assert.sameValue(x, 0); diff --git a/test/language/expressions/class/cpn-fields-computed-property-name-from-assignment-expression-logical-or.js b/test/language/expressions/class/cpn-fields-computed-property-name-from-assignment-expression-logical-or.js new file mode 100644 index 0000000000..8475d2be56 --- /dev/null +++ b/test/language/expressions/class/cpn-fields-computed-property-name-from-assignment-expression-logical-or.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-logical-or.case +// - src/computed-property-names/evaluation/class-expression-fields.template +/*--- +description: Computed property name from assignment expression logical or (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +let C = class { + [x ||= 1] = 2; + + static [x ||= 1] = 2; +}; + +let c = new C(); + +assert.sameValue( + c[x ||= 1], + 2 +); +assert.sameValue( + C[x ||= 1], + 2 +); + +assert.sameValue(x, 1); diff --git a/test/language/expressions/class/cpn-fields-computed-property-name-from-async-arrow-function-expression.js b/test/language/expressions/class/cpn-fields-computed-property-name-from-async-arrow-function-expression.js new file mode 100644 index 0000000000..135d214d51 --- /dev/null +++ b/test/language/expressions/class/cpn-fields-computed-property-name-from-async-arrow-function-expression.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-async-arrow-function-expression.case +// - src/computed-property-names/evaluation/class-expression-fields.template +/*--- +description: Computed property name from function expression (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [async () => {}] = 1; + + static [async () => {}] = 1; +}; + +let c = new C(); + +assert.sameValue( + c[async () => {}], + 1 +); +assert.sameValue( + C[async () => {}], + 1 +); diff --git a/test/language/expressions/class/cpn-fields-computed-property-name-from-condition-expression-false.js b/test/language/expressions/class/cpn-fields-computed-property-name-from-condition-expression-false.js new file mode 100644 index 0000000000..61cee2f7d1 --- /dev/null +++ b/test/language/expressions/class/cpn-fields-computed-property-name-from-condition-expression-false.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-condition-expression-false.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] +flags: [generated] +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 { + [false ? 1 : 2] = 1; + + static [false ? 1 : 2] = 1; +}; + +let c = new C(); + +assert.sameValue( + c[false ? 1 : 2], + 1 +); +assert.sameValue( + C[false ? 1 : 2], + 1 +); diff --git a/test/language/expressions/class/cpn-fields-computed-property-name-from-condition-expression-true.js b/test/language/expressions/class/cpn-fields-computed-property-name-from-condition-expression-true.js new file mode 100644 index 0000000000..e1688be289 --- /dev/null +++ b/test/language/expressions/class/cpn-fields-computed-property-name-from-condition-expression-true.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-condition-expression-true.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] +flags: [generated] +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 { + [true ? 1 : 2] = 2; + + static [true ? 1 : 2] = 2; +}; + +let c = new C(); + +assert.sameValue( + c[true ? 1 : 2], + 2 +); +assert.sameValue( + C[true ? 1 : 2], + 2 +); diff --git a/test/language/expressions/class/cpn-fields-computed-property-name-from-decimal-e-notational-literal.js b/test/language/expressions/class/cpn-fields-computed-property-name-from-decimal-e-notational-literal.js new file mode 100644 index 0000000000..0761d7563d --- /dev/null +++ b/test/language/expressions/class/cpn-fields-computed-property-name-from-decimal-e-notational-literal.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-decimal-e-notational-literal.case +// - src/computed-property-names/evaluation/class-expression-fields.template +/*--- +description: Computed property name from decimal e notational literal (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1.e1] = 2; + + static [1.e1] = 2; +}; + +let c = new C(); + +assert.sameValue( + c[1.e1], + 2 +); +assert.sameValue( + C[1.e1], + 2 +); diff --git a/test/language/expressions/class/cpn-fields-computed-property-name-from-decimal-literal.js b/test/language/expressions/class/cpn-fields-computed-property-name-from-decimal-literal.js new file mode 100644 index 0000000000..9df8e87c1e --- /dev/null +++ b/test/language/expressions/class/cpn-fields-computed-property-name-from-decimal-literal.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-decimal-literal.case +// - src/computed-property-names/evaluation/class-expression-fields.template +/*--- +description: Computed property name from decimal literal (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1.1] = 2; + + static [1.1] = 2; +}; + +let c = new C(); + +assert.sameValue( + c[1.1], + 2 +); +assert.sameValue( + C[1.1], + 2 +); diff --git a/test/language/expressions/class/cpn-fields-computed-property-name-from-exponetiation-expression.js b/test/language/expressions/class/cpn-fields-computed-property-name-from-exponetiation-expression.js new file mode 100644 index 0000000000..06b0e7b548 --- /dev/null +++ b/test/language/expressions/class/cpn-fields-computed-property-name-from-exponetiation-expression.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-exponetiation-expression.case +// - src/computed-property-names/evaluation/class-expression-fields.template +/*--- +description: Computed property name from exponentiation expression (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [2 ** 2] = 4; + + static [2 ** 2] = 4; +}; + +let c = new C(); + +assert.sameValue( + c[2 ** 2], + 4 +); +assert.sameValue( + C[2 ** 2], + 4 +); diff --git a/test/language/expressions/class/cpn-fields-computed-property-name-from-expression-coalesce.js b/test/language/expressions/class/cpn-fields-computed-property-name-from-expression-coalesce.js new file mode 100644 index 0000000000..4bbd99f9f1 --- /dev/null +++ b/test/language/expressions/class/cpn-fields-computed-property-name-from-expression-coalesce.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-expression-coalesce.case +// - src/computed-property-names/evaluation/class-expression-fields.template +/*--- +description: Computed property name from coalesce (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x; + + +let C = class { + [x ?? 1] = 2; + + static [x ?? 1] = 2; +}; + +let c = new C(); + +assert.sameValue( + c[x ?? 1], + 2 +); +assert.sameValue( + C[x ?? 1], + 2 +); + +assert.sameValue(x, undefined); diff --git a/test/language/expressions/class/cpn-fields-computed-property-name-from-expression-logical-and.js b/test/language/expressions/class/cpn-fields-computed-property-name-from-expression-logical-and.js new file mode 100644 index 0000000000..506cb4f31e --- /dev/null +++ b/test/language/expressions/class/cpn-fields-computed-property-name-from-expression-logical-and.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-expression-logical-and.case +// - src/computed-property-names/evaluation/class-expression-fields.template +/*--- +description: Computed property name from logical and (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +let C = class { + [x && 1] = 2; + + static [x && 1] = 2; +}; + +let c = new C(); + +assert.sameValue( + c[x && 1], + 2 +); +assert.sameValue( + C[x && 1], + 2 +); + +assert.sameValue(x, 0); diff --git a/test/language/expressions/class/cpn-fields-computed-property-name-from-expression-logical-or.js b/test/language/expressions/class/cpn-fields-computed-property-name-from-expression-logical-or.js new file mode 100644 index 0000000000..de6bb4999a --- /dev/null +++ b/test/language/expressions/class/cpn-fields-computed-property-name-from-expression-logical-or.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-expression-logical-or.case +// - src/computed-property-names/evaluation/class-expression-fields.template +/*--- +description: Computed property name from logical or (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +let C = class { + [x || 1] = 2; + + static [x || 1] = 2; +}; + +let c = new C(); + +assert.sameValue( + c[x || 1], + 2 +); +assert.sameValue( + C[x || 1], + 2 +); + +assert.sameValue(x, 0); diff --git a/test/language/expressions/class/cpn-fields-computed-property-name-from-function-declaration.js b/test/language/expressions/class/cpn-fields-computed-property-name-from-function-declaration.js new file mode 100644 index 0000000000..abfc51c0e4 --- /dev/null +++ b/test/language/expressions/class/cpn-fields-computed-property-name-from-function-declaration.js @@ -0,0 +1,54 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-function-declaration.case +// - src/computed-property-names/evaluation/class-expression-fields.template +/*--- +description: Computed property name from function (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 ] +---*/ +function f() {} + + +let C = class { + [f()] = 1; + + static [f()] = 1; +}; + +let c = new C(); + +assert.sameValue( + c[f()], + 1 +); +assert.sameValue( + C[f()], + 1 +); diff --git a/test/language/expressions/class/cpn-fields-computed-property-name-from-function-expression.js b/test/language/expressions/class/cpn-fields-computed-property-name-from-function-expression.js new file mode 100644 index 0000000000..a866b0f724 --- /dev/null +++ b/test/language/expressions/class/cpn-fields-computed-property-name-from-function-expression.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-function-expression.case +// - src/computed-property-names/evaluation/class-expression-fields.template +/*--- +description: Computed property name from function expression (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [function () {}] = 1; + + static [function () {}] = 1; +}; + +let c = new C(); + +assert.sameValue( + c[function () {}], + 1 +); +assert.sameValue( + C[function () {}], + 1 +); diff --git a/test/language/expressions/class/cpn-fields-computed-property-name-from-generator-function-declaration.js b/test/language/expressions/class/cpn-fields-computed-property-name-from-generator-function-declaration.js new file mode 100644 index 0000000000..cd0a21f1dd --- /dev/null +++ b/test/language/expressions/class/cpn-fields-computed-property-name-from-generator-function-declaration.js @@ -0,0 +1,54 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-generator-function-declaration.case +// - src/computed-property-names/evaluation/class-expression-fields.template +/*--- +description: Computed property name from generator function (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 ] +---*/ +function * g() { return 1; } + + +let C = class { + [g()] = 1; + + static [g()] = 1; +}; + +let c = new C(); + +assert.sameValue( + c[g()], + 1 +); +assert.sameValue( + C[g()], + 1 +); diff --git a/test/language/expressions/class/cpn-fields-computed-property-name-from-identifier.js b/test/language/expressions/class/cpn-fields-computed-property-name-from-identifier.js new file mode 100644 index 0000000000..bfe3f5e80b --- /dev/null +++ b/test/language/expressions/class/cpn-fields-computed-property-name-from-identifier.js @@ -0,0 +1,55 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-identifier.case +// - src/computed-property-names/evaluation/class-expression-fields.template +/*--- +description: Computed property name from string literal (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 1; + + + +let C = class { + [x] = '2'; + + static [x] = '2'; +}; + +let c = new C(); + +assert.sameValue( + c[x], + '2' +); +assert.sameValue( + C[x], + '2' +); diff --git a/test/language/expressions/class/cpn-fields-computed-property-name-from-integer-e-notational-literal.js b/test/language/expressions/class/cpn-fields-computed-property-name-from-integer-e-notational-literal.js new file mode 100644 index 0000000000..75a9165925 --- /dev/null +++ b/test/language/expressions/class/cpn-fields-computed-property-name-from-integer-e-notational-literal.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-integer-e-notational-literal.case +// - src/computed-property-names/evaluation/class-expression-fields.template +/*--- +description: Computed property name from numeric literal (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1] = 2; + + static [1] = 2; +}; + +let c = new C(); + +assert.sameValue( + c[1], + 2 +); +assert.sameValue( + C[1], + 2 +); diff --git a/test/language/expressions/class/cpn-fields-computed-property-name-from-integer-separators.js b/test/language/expressions/class/cpn-fields-computed-property-name-from-integer-separators.js new file mode 100644 index 0000000000..c1d6e3e954 --- /dev/null +++ b/test/language/expressions/class/cpn-fields-computed-property-name-from-integer-separators.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-integer-separators.case +// - src/computed-property-names/evaluation/class-expression-fields.template +/*--- +description: Computed property name from integer with separators (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1_2_3_4_5_6_7_8] = 1_2_3_4_5_6_7_8; + + static [1_2_3_4_5_6_7_8] = 1_2_3_4_5_6_7_8; +}; + +let c = new C(); + +assert.sameValue( + c[1_2_3_4_5_6_7_8], + 1_2_3_4_5_6_7_8 +); +assert.sameValue( + C[1_2_3_4_5_6_7_8], + 1_2_3_4_5_6_7_8 +); diff --git a/test/language/expressions/class/cpn-fields-computed-property-name-from-math.js b/test/language/expressions/class/cpn-fields-computed-property-name-from-math.js new file mode 100644 index 0000000000..3a56e0a86d --- /dev/null +++ b/test/language/expressions/class/cpn-fields-computed-property-name-from-math.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-math.case +// - src/computed-property-names/evaluation/class-expression-fields.template +/*--- +description: Computed property name from math (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1 + 2 - 3 * 4 / 5 ** 6] = 2.999232; + + static [1 + 2 - 3 * 4 / 5 ** 6] = 2.999232; +}; + +let c = new C(); + +assert.sameValue( + c[1 + 2 - 3 * 4 / 5 ** 6], + 2.999232 +); +assert.sameValue( + C[1 + 2 - 3 * 4 / 5 ** 6], + 2.999232 +); diff --git a/test/language/expressions/class/cpn-fields-computed-property-name-from-multiplicative-expression-div.js b/test/language/expressions/class/cpn-fields-computed-property-name-from-multiplicative-expression-div.js new file mode 100644 index 0000000000..d656de764f --- /dev/null +++ b/test/language/expressions/class/cpn-fields-computed-property-name-from-multiplicative-expression-div.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-multiplicative-expression-div.case +// - src/computed-property-names/evaluation/class-expression-fields.template +/*--- +description: Computed property name from multiplicative expression "divide" (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1 / 1] = 1; + + static [1 / 1] = 1; +}; + +let c = new C(); + +assert.sameValue( + c[1 / 1], + 1 +); +assert.sameValue( + C[1 / 1], + 1 +); diff --git a/test/language/expressions/class/cpn-fields-computed-property-name-from-multiplicative-expression-mult.js b/test/language/expressions/class/cpn-fields-computed-property-name-from-multiplicative-expression-mult.js new file mode 100644 index 0000000000..11d7ec99d4 --- /dev/null +++ b/test/language/expressions/class/cpn-fields-computed-property-name-from-multiplicative-expression-mult.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-multiplicative-expression-mult.case +// - src/computed-property-names/evaluation/class-expression-fields.template +/*--- +description: Computed property name from multiplicative expression "multiply" (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1 * 1] = 1; + + static [1 * 1] = 1; +}; + +let c = new C(); + +assert.sameValue( + c[1 * 1], + 1 +); +assert.sameValue( + C[1 * 1], + 1 +); diff --git a/test/language/expressions/class/cpn-fields-computed-property-name-from-numeric-literal.js b/test/language/expressions/class/cpn-fields-computed-property-name-from-numeric-literal.js new file mode 100644 index 0000000000..1ba5f6014c --- /dev/null +++ b/test/language/expressions/class/cpn-fields-computed-property-name-from-numeric-literal.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-numeric-literal.case +// - src/computed-property-names/evaluation/class-expression-fields.template +/*--- +description: Computed property name from numeric literal (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1] = 2; + + static [1] = 2; +}; + +let c = new C(); + +assert.sameValue( + c[1], + 2 +); +assert.sameValue( + C[1], + 2 +); diff --git a/test/language/expressions/class/cpn-fields-computed-property-name-from-string-literal.js b/test/language/expressions/class/cpn-fields-computed-property-name-from-string-literal.js new file mode 100644 index 0000000000..55c2278621 --- /dev/null +++ b/test/language/expressions/class/cpn-fields-computed-property-name-from-string-literal.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-string-literal.case +// - src/computed-property-names/evaluation/class-expression-fields.template +/*--- +description: Computed property name from string literal (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + ['1'] = '2'; + + static ['1'] = '2'; +}; + +let c = new C(); + +assert.sameValue( + c['1'], + '2' +); +assert.sameValue( + C['1'], + '2' +); diff --git a/test/language/expressions/class/cpn-fields-computed-property-name-from-yield-expression.js b/test/language/expressions/class/cpn-fields-computed-property-name-from-yield-expression.js new file mode 100644 index 0000000000..f50441bfcb --- /dev/null +++ b/test/language/expressions/class/cpn-fields-computed-property-name-from-yield-expression.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-yield-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] +flags: [generated] +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 { + [true ? 1 : 2] = 2; + + static [true ? 1 : 2] = 2; +}; + +let c = new C(); + +assert.sameValue( + c[true ? 1 : 2], + 2 +); +assert.sameValue( + C[true ? 1 : 2], + 2 +); diff --git a/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-additive-expression-add.js b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-additive-expression-add.js new file mode 100644 index 0000000000..2392f6bd69 --- /dev/null +++ b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-additive-expression-add.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-additive-expression-add.case +// - src/computed-property-names/evaluation/class-expression-fields-methods.template +/*--- +description: Computed property name from additive expression "add" (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1 + 1] = () => { + return 2; + }; + + static [1 + 1] = () => { + return 2; + }; +}; + +let c = new C(); + +assert.sameValue( + c[1 + 1](), + 2 +); +assert.sameValue( + C[1 + 1](), + 2 +); diff --git a/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-additive-expression-subtract.js b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-additive-expression-subtract.js new file mode 100644 index 0000000000..54d286ab6c --- /dev/null +++ b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-additive-expression-subtract.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-additive-expression-subtract.case +// - src/computed-property-names/evaluation/class-expression-fields-methods.template +/*--- +description: Computed property name from additive expression "subtract" (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1 - 1] = () => { + return 0; + }; + + static [1 - 1] = () => { + return 0; + }; +}; + +let c = new C(); + +assert.sameValue( + c[1 - 1](), + 0 +); +assert.sameValue( + C[1 - 1](), + 0 +); diff --git a/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-arrow-function-expression.js b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-arrow-function-expression.js new file mode 100644 index 0000000000..6321d4c7c8 --- /dev/null +++ b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-arrow-function-expression.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-arrow-function-expression.case +// - src/computed-property-names/evaluation/class-expression-fields-methods.template +/*--- +description: Computed property name from arrow function (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [() => { }] = () => { + return 1; + }; + + static [() => { }] = () => { + return 1; + }; +}; + +let c = new C(); + +assert.sameValue( + c[() => { }](), + 1 +); +assert.sameValue( + C[() => { }](), + 1 +); diff --git a/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-assignment-expression-assignment.js b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-assignment-expression-assignment.js new file mode 100644 index 0000000000..cf3889a590 --- /dev/null +++ b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-assignment-expression-assignment.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-assignment.case +// - src/computed-property-names/evaluation/class-expression-fields-methods.template +/*--- +description: Computed property name from assignment expression (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +let C = class { + [x = 1] = () => { + return 2; + }; + + static [x = 1] = () => { + return 2; + }; +}; + +let c = new C(); + +assert.sameValue( + c[x = 1](), + 2 +); +assert.sameValue( + C[x = 1](), + 2 +); + +assert.sameValue(x, 1); diff --git a/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-assignment-expression-bitwise-or.js b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-assignment-expression-bitwise-or.js new file mode 100644 index 0000000000..d840f4dfa4 --- /dev/null +++ b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-assignment-expression-bitwise-or.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-bitwise-or.case +// - src/computed-property-names/evaluation/class-expression-fields-methods.template +/*--- +description: Computed property name from assignment expression bitwise or (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +let C = class { + [x |= 1] = () => { + return 2; + }; + + static [x |= 1] = () => { + return 2; + }; +}; + +let c = new C(); + +assert.sameValue( + c[x |= 1](), + 2 +); +assert.sameValue( + C[x |= 1](), + 2 +); + +assert.sameValue(x, 1); diff --git a/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-assignment-expression-coalesce.js b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-assignment-expression-coalesce.js new file mode 100644 index 0000000000..13d53bcf17 --- /dev/null +++ b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-assignment-expression-coalesce.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-coalesce.case +// - src/computed-property-names/evaluation/class-expression-fields-methods.template +/*--- +description: Computed property name from assignment expression coalesce (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = null; + + +let C = class { + [x ??= 1] = () => { + return 2; + }; + + static [x ??= 1] = () => { + return 2; + }; +}; + +let c = new C(); + +assert.sameValue( + c[x ??= 1](), + 2 +); +assert.sameValue( + C[x ??= 1](), + 2 +); + +assert.sameValue(x, 1); diff --git a/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-assignment-expression-logical-and.js b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-assignment-expression-logical-and.js new file mode 100644 index 0000000000..42f03288ba --- /dev/null +++ b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-assignment-expression-logical-and.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-logical-and.case +// - src/computed-property-names/evaluation/class-expression-fields-methods.template +/*--- +description: Computed property name from assignment expression logical and (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +let C = class { + [x &&= 1] = () => { + return 2; + }; + + static [x &&= 1] = () => { + return 2; + }; +}; + +let c = new C(); + +assert.sameValue( + c[x &&= 1](), + 2 +); +assert.sameValue( + C[x &&= 1](), + 2 +); + +assert.sameValue(x, 0); diff --git a/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-assignment-expression-logical-or.js b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-assignment-expression-logical-or.js new file mode 100644 index 0000000000..259719d3d6 --- /dev/null +++ b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-assignment-expression-logical-or.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-logical-or.case +// - src/computed-property-names/evaluation/class-expression-fields-methods.template +/*--- +description: Computed property name from assignment expression logical or (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +let C = class { + [x ||= 1] = () => { + return 2; + }; + + static [x ||= 1] = () => { + return 2; + }; +}; + +let c = new C(); + +assert.sameValue( + c[x ||= 1](), + 2 +); +assert.sameValue( + C[x ||= 1](), + 2 +); + +assert.sameValue(x, 1); diff --git a/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-async-arrow-function-expression.js b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-async-arrow-function-expression.js new file mode 100644 index 0000000000..08f6668deb --- /dev/null +++ b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-async-arrow-function-expression.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-async-arrow-function-expression.case +// - src/computed-property-names/evaluation/class-expression-fields-methods.template +/*--- +description: Computed property name from function expression (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [async () => {}] = () => { + return 1; + }; + + static [async () => {}] = () => { + return 1; + }; +}; + +let c = new C(); + +assert.sameValue( + c[async () => {}](), + 1 +); +assert.sameValue( + C[async () => {}](), + 1 +); diff --git a/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-condition-expression-false.js b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-condition-expression-false.js new file mode 100644 index 0000000000..53f609f882 --- /dev/null +++ b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-condition-expression-false.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-condition-expression-false.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] +flags: [generated] +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 { + [false ? 1 : 2] = () => { + return 1; + }; + + static [false ? 1 : 2] = () => { + return 1; + }; +}; + +let c = new C(); + +assert.sameValue( + c[false ? 1 : 2](), + 1 +); +assert.sameValue( + C[false ? 1 : 2](), + 1 +); diff --git a/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-condition-expression-true.js b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-condition-expression-true.js new file mode 100644 index 0000000000..68f7c16084 --- /dev/null +++ b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-condition-expression-true.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-condition-expression-true.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] +flags: [generated] +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 { + [true ? 1 : 2] = () => { + return 2; + }; + + static [true ? 1 : 2] = () => { + return 2; + }; +}; + +let c = new C(); + +assert.sameValue( + c[true ? 1 : 2](), + 2 +); +assert.sameValue( + C[true ? 1 : 2](), + 2 +); diff --git a/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-decimal-e-notational-literal.js b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-decimal-e-notational-literal.js new file mode 100644 index 0000000000..5365fd6be8 --- /dev/null +++ b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-decimal-e-notational-literal.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-decimal-e-notational-literal.case +// - src/computed-property-names/evaluation/class-expression-fields-methods.template +/*--- +description: Computed property name from decimal e notational literal (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1.e1] = () => { + return 2; + }; + + static [1.e1] = () => { + return 2; + }; +}; + +let c = new C(); + +assert.sameValue( + c[1.e1](), + 2 +); +assert.sameValue( + C[1.e1](), + 2 +); diff --git a/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-decimal-literal.js b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-decimal-literal.js new file mode 100644 index 0000000000..c3ba5e4fa6 --- /dev/null +++ b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-decimal-literal.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-decimal-literal.case +// - src/computed-property-names/evaluation/class-expression-fields-methods.template +/*--- +description: Computed property name from decimal literal (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1.1] = () => { + return 2; + }; + + static [1.1] = () => { + return 2; + }; +}; + +let c = new C(); + +assert.sameValue( + c[1.1](), + 2 +); +assert.sameValue( + C[1.1](), + 2 +); diff --git a/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-exponetiation-expression.js b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-exponetiation-expression.js new file mode 100644 index 0000000000..335fe625d9 --- /dev/null +++ b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-exponetiation-expression.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-exponetiation-expression.case +// - src/computed-property-names/evaluation/class-expression-fields-methods.template +/*--- +description: Computed property name from exponentiation expression (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [2 ** 2] = () => { + return 4; + }; + + static [2 ** 2] = () => { + return 4; + }; +}; + +let c = new C(); + +assert.sameValue( + c[2 ** 2](), + 4 +); +assert.sameValue( + C[2 ** 2](), + 4 +); diff --git a/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-expression-coalesce.js b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-expression-coalesce.js new file mode 100644 index 0000000000..b1375ba7c5 --- /dev/null +++ b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-expression-coalesce.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-expression-coalesce.case +// - src/computed-property-names/evaluation/class-expression-fields-methods.template +/*--- +description: Computed property name from coalesce (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x; + + +let C = class { + [x ?? 1] = () => { + return 2; + }; + + static [x ?? 1] = () => { + return 2; + }; +}; + +let c = new C(); + +assert.sameValue( + c[x ?? 1](), + 2 +); +assert.sameValue( + C[x ?? 1](), + 2 +); + +assert.sameValue(x, undefined); diff --git a/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-expression-logical-and.js b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-expression-logical-and.js new file mode 100644 index 0000000000..a6f46b6517 --- /dev/null +++ b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-expression-logical-and.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-expression-logical-and.case +// - src/computed-property-names/evaluation/class-expression-fields-methods.template +/*--- +description: Computed property name from logical and (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +let C = class { + [x && 1] = () => { + return 2; + }; + + static [x && 1] = () => { + return 2; + }; +}; + +let c = new C(); + +assert.sameValue( + c[x && 1](), + 2 +); +assert.sameValue( + C[x && 1](), + 2 +); + +assert.sameValue(x, 0); diff --git a/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-expression-logical-or.js b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-expression-logical-or.js new file mode 100644 index 0000000000..80e6df802a --- /dev/null +++ b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-expression-logical-or.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-expression-logical-or.case +// - src/computed-property-names/evaluation/class-expression-fields-methods.template +/*--- +description: Computed property name from logical or (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +let C = class { + [x || 1] = () => { + return 2; + }; + + static [x || 1] = () => { + return 2; + }; +}; + +let c = new C(); + +assert.sameValue( + c[x || 1](), + 2 +); +assert.sameValue( + C[x || 1](), + 2 +); + +assert.sameValue(x, 0); diff --git a/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-function-declaration.js b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-function-declaration.js new file mode 100644 index 0000000000..fcd37f6caa --- /dev/null +++ b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-function-declaration.js @@ -0,0 +1,58 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-function-declaration.case +// - src/computed-property-names/evaluation/class-expression-fields-methods.template +/*--- +description: Computed property name from function (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 ] +---*/ +function f() {} + + +let C = class { + [f()] = () => { + return 1; + }; + + static [f()] = () => { + return 1; + }; +}; + +let c = new C(); + +assert.sameValue( + c[f()](), + 1 +); +assert.sameValue( + C[f()](), + 1 +); diff --git a/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-function-expression.js b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-function-expression.js new file mode 100644 index 0000000000..0b6bedd8f7 --- /dev/null +++ b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-function-expression.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-function-expression.case +// - src/computed-property-names/evaluation/class-expression-fields-methods.template +/*--- +description: Computed property name from function expression (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [function () {}] = () => { + return 1; + }; + + static [function () {}] = () => { + return 1; + }; +}; + +let c = new C(); + +assert.sameValue( + c[function () {}](), + 1 +); +assert.sameValue( + C[function () {}](), + 1 +); diff --git a/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-generator-function-declaration.js b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-generator-function-declaration.js new file mode 100644 index 0000000000..33a3280b63 --- /dev/null +++ b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-generator-function-declaration.js @@ -0,0 +1,58 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-generator-function-declaration.case +// - src/computed-property-names/evaluation/class-expression-fields-methods.template +/*--- +description: Computed property name from generator function (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 ] +---*/ +function * g() { return 1; } + + +let C = class { + [g()] = () => { + return 1; + }; + + static [g()] = () => { + return 1; + }; +}; + +let c = new C(); + +assert.sameValue( + c[g()](), + 1 +); +assert.sameValue( + C[g()](), + 1 +); diff --git a/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-identifier.js b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-identifier.js new file mode 100644 index 0000000000..9bbb02021c --- /dev/null +++ b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-identifier.js @@ -0,0 +1,59 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-identifier.case +// - src/computed-property-names/evaluation/class-expression-fields-methods.template +/*--- +description: Computed property name from string literal (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 1; + + + +let C = class { + [x] = () => { + return '2'; + }; + + static [x] = () => { + return '2'; + }; +}; + +let c = new C(); + +assert.sameValue( + c[x](), + '2' +); +assert.sameValue( + C[x](), + '2' +); diff --git a/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-integer-e-notational-literal.js b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-integer-e-notational-literal.js new file mode 100644 index 0000000000..319851569c --- /dev/null +++ b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-integer-e-notational-literal.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-integer-e-notational-literal.case +// - src/computed-property-names/evaluation/class-expression-fields-methods.template +/*--- +description: Computed property name from numeric literal (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1] = () => { + return 2; + }; + + static [1] = () => { + return 2; + }; +}; + +let c = new C(); + +assert.sameValue( + c[1](), + 2 +); +assert.sameValue( + C[1](), + 2 +); diff --git a/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-integer-separators.js b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-integer-separators.js new file mode 100644 index 0000000000..69043df6d7 --- /dev/null +++ b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-integer-separators.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-integer-separators.case +// - src/computed-property-names/evaluation/class-expression-fields-methods.template +/*--- +description: Computed property name from integer with separators (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1_2_3_4_5_6_7_8] = () => { + return 1_2_3_4_5_6_7_8; + }; + + static [1_2_3_4_5_6_7_8] = () => { + return 1_2_3_4_5_6_7_8; + }; +}; + +let c = new C(); + +assert.sameValue( + c[1_2_3_4_5_6_7_8](), + 1_2_3_4_5_6_7_8 +); +assert.sameValue( + C[1_2_3_4_5_6_7_8](), + 1_2_3_4_5_6_7_8 +); diff --git a/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-math.js b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-math.js new file mode 100644 index 0000000000..4df3806fbc --- /dev/null +++ b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-math.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-math.case +// - src/computed-property-names/evaluation/class-expression-fields-methods.template +/*--- +description: Computed property name from math (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1 + 2 - 3 * 4 / 5 ** 6] = () => { + return 2.999232; + }; + + static [1 + 2 - 3 * 4 / 5 ** 6] = () => { + return 2.999232; + }; +}; + +let c = new C(); + +assert.sameValue( + c[1 + 2 - 3 * 4 / 5 ** 6](), + 2.999232 +); +assert.sameValue( + C[1 + 2 - 3 * 4 / 5 ** 6](), + 2.999232 +); diff --git a/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-multiplicative-expression-div.js b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-multiplicative-expression-div.js new file mode 100644 index 0000000000..e45e702bdd --- /dev/null +++ b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-multiplicative-expression-div.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-multiplicative-expression-div.case +// - src/computed-property-names/evaluation/class-expression-fields-methods.template +/*--- +description: Computed property name from multiplicative expression "divide" (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1 / 1] = () => { + return 1; + }; + + static [1 / 1] = () => { + return 1; + }; +}; + +let c = new C(); + +assert.sameValue( + c[1 / 1](), + 1 +); +assert.sameValue( + C[1 / 1](), + 1 +); diff --git a/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-multiplicative-expression-mult.js b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-multiplicative-expression-mult.js new file mode 100644 index 0000000000..25ee4d4f7d --- /dev/null +++ b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-multiplicative-expression-mult.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-multiplicative-expression-mult.case +// - src/computed-property-names/evaluation/class-expression-fields-methods.template +/*--- +description: Computed property name from multiplicative expression "multiply" (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1 * 1] = () => { + return 1; + }; + + static [1 * 1] = () => { + return 1; + }; +}; + +let c = new C(); + +assert.sameValue( + c[1 * 1](), + 1 +); +assert.sameValue( + C[1 * 1](), + 1 +); diff --git a/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-numeric-literal.js b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-numeric-literal.js new file mode 100644 index 0000000000..9d13e21e5d --- /dev/null +++ b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-numeric-literal.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-numeric-literal.case +// - src/computed-property-names/evaluation/class-expression-fields-methods.template +/*--- +description: Computed property name from numeric literal (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1] = () => { + return 2; + }; + + static [1] = () => { + return 2; + }; +}; + +let c = new C(); + +assert.sameValue( + c[1](), + 2 +); +assert.sameValue( + C[1](), + 2 +); diff --git a/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-string-literal.js b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-string-literal.js new file mode 100644 index 0000000000..c0fe0cb843 --- /dev/null +++ b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-string-literal.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-string-literal.case +// - src/computed-property-names/evaluation/class-expression-fields-methods.template +/*--- +description: Computed property name from string literal (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + ['1'] = () => { + return '2'; + }; + + static ['1'] = () => { + return '2'; + }; +}; + +let c = new C(); + +assert.sameValue( + c['1'](), + '2' +); +assert.sameValue( + C['1'](), + '2' +); diff --git a/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-yield-expression.js b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-yield-expression.js new file mode 100644 index 0000000000..ef4c92c8cf --- /dev/null +++ b/test/language/expressions/class/cpn-fields-methods-computed-property-name-from-yield-expression.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-yield-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] +flags: [generated] +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 { + [true ? 1 : 2] = () => { + return 2; + }; + + static [true ? 1 : 2] = () => { + return 2; + }; +}; + +let c = new C(); + +assert.sameValue( + c[true ? 1 : 2](), + 2 +); +assert.sameValue( + C[true ? 1 : 2](), + 2 +); diff --git a/test/language/expressions/object/cpn-computed-property-name-from-additive-expression-add.js b/test/language/expressions/object/cpn-computed-property-name-from-additive-expression-add.js new file mode 100644 index 0000000000..49540ded12 --- /dev/null +++ b/test/language/expressions/object/cpn-computed-property-name-from-additive-expression-add.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-additive-expression-add.case +// - src/computed-property-names/evaluation/object-literal.template +/*--- +description: Computed property name from additive expression "add" (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 = { + [1 + 1]: 2 +}; + +assert.sameValue( + o[1 + 1], + 2 +); diff --git a/test/language/expressions/object/cpn-computed-property-name-from-additive-expression-subtract.js b/test/language/expressions/object/cpn-computed-property-name-from-additive-expression-subtract.js new file mode 100644 index 0000000000..5210945540 --- /dev/null +++ b/test/language/expressions/object/cpn-computed-property-name-from-additive-expression-subtract.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-additive-expression-subtract.case +// - src/computed-property-names/evaluation/object-literal.template +/*--- +description: Computed property name from additive expression "subtract" (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 = { + [1 - 1]: 0 +}; + +assert.sameValue( + o[1 - 1], + 0 +); diff --git a/test/language/expressions/object/cpn-computed-property-name-from-arrow-function-expression.js b/test/language/expressions/object/cpn-computed-property-name-from-arrow-function-expression.js new file mode 100644 index 0000000000..7d97f1becf --- /dev/null +++ b/test/language/expressions/object/cpn-computed-property-name-from-arrow-function-expression.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-arrow-function-expression.case +// - src/computed-property-names/evaluation/object-literal.template +/*--- +description: Computed property name from arrow function (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 = { + [() => { }]: 1 +}; + +assert.sameValue( + o[() => { }], + 1 +); diff --git a/test/language/expressions/object/cpn-computed-property-name-from-assignment-expression-assignment.js b/test/language/expressions/object/cpn-computed-property-name-from-assignment-expression-assignment.js new file mode 100644 index 0000000000..355026608a --- /dev/null +++ b/test/language/expressions/object/cpn-computed-property-name-from-assignment-expression-assignment.js @@ -0,0 +1,37 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-assignment.case +// - src/computed-property-names/evaluation/object-literal.template +/*--- +description: Computed property name from assignment 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 x = 0; + + +let o = { + [x = 1]: 2 +}; + +assert.sameValue( + o[x = 1], + 2 +); + +assert.sameValue(x, 1); diff --git a/test/language/expressions/object/cpn-computed-property-name-from-assignment-expression-bitwise-or.js b/test/language/expressions/object/cpn-computed-property-name-from-assignment-expression-bitwise-or.js new file mode 100644 index 0000000000..3442e31ba2 --- /dev/null +++ b/test/language/expressions/object/cpn-computed-property-name-from-assignment-expression-bitwise-or.js @@ -0,0 +1,37 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-bitwise-or.case +// - src/computed-property-names/evaluation/object-literal.template +/*--- +description: Computed property name from assignment expression bitwise or (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 x = 0; + + +let o = { + [x |= 1]: 2 +}; + +assert.sameValue( + o[x |= 1], + 2 +); + +assert.sameValue(x, 1); diff --git a/test/language/expressions/object/cpn-computed-property-name-from-assignment-expression-coalesce.js b/test/language/expressions/object/cpn-computed-property-name-from-assignment-expression-coalesce.js new file mode 100644 index 0000000000..d0398515f6 --- /dev/null +++ b/test/language/expressions/object/cpn-computed-property-name-from-assignment-expression-coalesce.js @@ -0,0 +1,37 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-coalesce.case +// - src/computed-property-names/evaluation/object-literal.template +/*--- +description: Computed property name from assignment expression coalesce (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 x = null; + + +let o = { + [x ??= 1]: 2 +}; + +assert.sameValue( + o[x ??= 1], + 2 +); + +assert.sameValue(x, 1); diff --git a/test/language/expressions/object/cpn-computed-property-name-from-assignment-expression-logical-and.js b/test/language/expressions/object/cpn-computed-property-name-from-assignment-expression-logical-and.js new file mode 100644 index 0000000000..7eb0ea592f --- /dev/null +++ b/test/language/expressions/object/cpn-computed-property-name-from-assignment-expression-logical-and.js @@ -0,0 +1,37 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-logical-and.case +// - src/computed-property-names/evaluation/object-literal.template +/*--- +description: Computed property name from assignment expression logical and (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 x = 0; + + +let o = { + [x &&= 1]: 2 +}; + +assert.sameValue( + o[x &&= 1], + 2 +); + +assert.sameValue(x, 0); diff --git a/test/language/expressions/object/cpn-computed-property-name-from-assignment-expression-logical-or.js b/test/language/expressions/object/cpn-computed-property-name-from-assignment-expression-logical-or.js new file mode 100644 index 0000000000..b2efa1bdb1 --- /dev/null +++ b/test/language/expressions/object/cpn-computed-property-name-from-assignment-expression-logical-or.js @@ -0,0 +1,37 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-logical-or.case +// - src/computed-property-names/evaluation/object-literal.template +/*--- +description: Computed property name from assignment expression logical or (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 x = 0; + + +let o = { + [x ||= 1]: 2 +}; + +assert.sameValue( + o[x ||= 1], + 2 +); + +assert.sameValue(x, 1); diff --git a/test/language/expressions/object/cpn-computed-property-name-from-async-arrow-function-expression.js b/test/language/expressions/object/cpn-computed-property-name-from-async-arrow-function-expression.js new file mode 100644 index 0000000000..824515c52a --- /dev/null +++ b/test/language/expressions/object/cpn-computed-property-name-from-async-arrow-function-expression.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-async-arrow-function-expression.case +// - src/computed-property-names/evaluation/object-literal.template +/*--- +description: Computed property name from function 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 = { + [async () => {}]: 1 +}; + +assert.sameValue( + o[async () => {}], + 1 +); diff --git a/test/language/expressions/object/cpn-computed-property-name-from-condition-expression-false.js b/test/language/expressions/object/cpn-computed-property-name-from-condition-expression-false.js new file mode 100644 index 0000000000..22ae53b119 --- /dev/null +++ b/test/language/expressions/object/cpn-computed-property-name-from-condition-expression-false.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-condition-expression-false.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] +flags: [generated] +info: | + ObjectLiteral: + { PropertyDefinitionList } + + PropertyDefinitionList: + PropertyDefinition + + PropertyDefinition: + PropertyName: AssignmentExpression + + PropertyName: + ComputedPropertyName + + ComputedPropertyName: + [ AssignmentExpression ] +---*/ + + +let o = { + [false ? 1 : 2]: 1 +}; + +assert.sameValue( + o[false ? 1 : 2], + 1 +); diff --git a/test/language/expressions/object/cpn-computed-property-name-from-condition-expression-true.js b/test/language/expressions/object/cpn-computed-property-name-from-condition-expression-true.js new file mode 100644 index 0000000000..11aba9c85b --- /dev/null +++ b/test/language/expressions/object/cpn-computed-property-name-from-condition-expression-true.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-condition-expression-true.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] +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 +); diff --git a/test/language/expressions/object/cpn-computed-property-name-from-decimal-e-notational-literal.js b/test/language/expressions/object/cpn-computed-property-name-from-decimal-e-notational-literal.js new file mode 100644 index 0000000000..cd455a8268 --- /dev/null +++ b/test/language/expressions/object/cpn-computed-property-name-from-decimal-e-notational-literal.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-decimal-e-notational-literal.case +// - src/computed-property-names/evaluation/object-literal.template +/*--- +description: Computed property name from decimal e notational literal (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 = { + [1.e1]: 2 +}; + +assert.sameValue( + o[1.e1], + 2 +); diff --git a/test/language/expressions/object/cpn-computed-property-name-from-decimal-literal.js b/test/language/expressions/object/cpn-computed-property-name-from-decimal-literal.js new file mode 100644 index 0000000000..1b8531baa5 --- /dev/null +++ b/test/language/expressions/object/cpn-computed-property-name-from-decimal-literal.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-decimal-literal.case +// - src/computed-property-names/evaluation/object-literal.template +/*--- +description: Computed property name from decimal literal (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 = { + [1.1]: 2 +}; + +assert.sameValue( + o[1.1], + 2 +); diff --git a/test/language/expressions/object/cpn-computed-property-name-from-exponetiation-expression.js b/test/language/expressions/object/cpn-computed-property-name-from-exponetiation-expression.js new file mode 100644 index 0000000000..e5163a41f4 --- /dev/null +++ b/test/language/expressions/object/cpn-computed-property-name-from-exponetiation-expression.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-exponetiation-expression.case +// - src/computed-property-names/evaluation/object-literal.template +/*--- +description: Computed property name from exponentiation 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 = { + [2 ** 2]: 4 +}; + +assert.sameValue( + o[2 ** 2], + 4 +); diff --git a/test/language/expressions/object/cpn-computed-property-name-from-expression-coalesce.js b/test/language/expressions/object/cpn-computed-property-name-from-expression-coalesce.js new file mode 100644 index 0000000000..be1c7d285b --- /dev/null +++ b/test/language/expressions/object/cpn-computed-property-name-from-expression-coalesce.js @@ -0,0 +1,37 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-expression-coalesce.case +// - src/computed-property-names/evaluation/object-literal.template +/*--- +description: Computed property name from coalesce (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 x; + + +let o = { + [x ?? 1]: 2 +}; + +assert.sameValue( + o[x ?? 1], + 2 +); + +assert.sameValue(x, undefined); diff --git a/test/language/expressions/object/cpn-computed-property-name-from-expression-logical-and.js b/test/language/expressions/object/cpn-computed-property-name-from-expression-logical-and.js new file mode 100644 index 0000000000..1737449179 --- /dev/null +++ b/test/language/expressions/object/cpn-computed-property-name-from-expression-logical-and.js @@ -0,0 +1,37 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-expression-logical-and.case +// - src/computed-property-names/evaluation/object-literal.template +/*--- +description: Computed property name from logical and (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 x = 0; + + +let o = { + [x && 1]: 2 +}; + +assert.sameValue( + o[x && 1], + 2 +); + +assert.sameValue(x, 0); diff --git a/test/language/expressions/object/cpn-computed-property-name-from-expression-logical-or.js b/test/language/expressions/object/cpn-computed-property-name-from-expression-logical-or.js new file mode 100644 index 0000000000..9437daec37 --- /dev/null +++ b/test/language/expressions/object/cpn-computed-property-name-from-expression-logical-or.js @@ -0,0 +1,37 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-expression-logical-or.case +// - src/computed-property-names/evaluation/object-literal.template +/*--- +description: Computed property name from logical or (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 x = 0; + + +let o = { + [x || 1]: 2 +}; + +assert.sameValue( + o[x || 1], + 2 +); + +assert.sameValue(x, 0); diff --git a/test/language/expressions/object/cpn-computed-property-name-from-function-declaration.js b/test/language/expressions/object/cpn-computed-property-name-from-function-declaration.js new file mode 100644 index 0000000000..ffd47142bc --- /dev/null +++ b/test/language/expressions/object/cpn-computed-property-name-from-function-declaration.js @@ -0,0 +1,35 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-function-declaration.case +// - src/computed-property-names/evaluation/object-literal.template +/*--- +description: Computed property name from function (ComputedPropertyName in ObjectLiteral) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +info: | + ObjectLiteral: + { PropertyDefinitionList } + + PropertyDefinitionList: + PropertyDefinition + + PropertyDefinition: + PropertyName: AssignmentExpression + + PropertyName: + ComputedPropertyName + + ComputedPropertyName: + [ AssignmentExpression ] +---*/ +function f() {} + + +let o = { + [f()]: 1 +}; + +assert.sameValue( + o[f()], + 1 +); diff --git a/test/language/expressions/object/cpn-computed-property-name-from-function-expression.js b/test/language/expressions/object/cpn-computed-property-name-from-function-expression.js new file mode 100644 index 0000000000..e63a3839f2 --- /dev/null +++ b/test/language/expressions/object/cpn-computed-property-name-from-function-expression.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-function-expression.case +// - src/computed-property-names/evaluation/object-literal.template +/*--- +description: Computed property name from function 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 = { + [function () {}]: 1 +}; + +assert.sameValue( + o[function () {}], + 1 +); diff --git a/test/language/expressions/object/cpn-computed-property-name-from-generator-function-declaration.js b/test/language/expressions/object/cpn-computed-property-name-from-generator-function-declaration.js new file mode 100644 index 0000000000..96e88354b3 --- /dev/null +++ b/test/language/expressions/object/cpn-computed-property-name-from-generator-function-declaration.js @@ -0,0 +1,35 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-generator-function-declaration.case +// - src/computed-property-names/evaluation/object-literal.template +/*--- +description: Computed property name from generator function (ComputedPropertyName in ObjectLiteral) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +info: | + ObjectLiteral: + { PropertyDefinitionList } + + PropertyDefinitionList: + PropertyDefinition + + PropertyDefinition: + PropertyName: AssignmentExpression + + PropertyName: + ComputedPropertyName + + ComputedPropertyName: + [ AssignmentExpression ] +---*/ +function * g() { return 1; } + + +let o = { + [g()]: 1 +}; + +assert.sameValue( + o[g()], + 1 +); diff --git a/test/language/expressions/object/cpn-computed-property-name-from-identifier.js b/test/language/expressions/object/cpn-computed-property-name-from-identifier.js new file mode 100644 index 0000000000..d5696600d3 --- /dev/null +++ b/test/language/expressions/object/cpn-computed-property-name-from-identifier.js @@ -0,0 +1,36 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-identifier.case +// - src/computed-property-names/evaluation/object-literal.template +/*--- +description: Computed property name from string literal (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 x = 1; + + + +let o = { + [x]: '2' +}; + +assert.sameValue( + o[x], + '2' +); diff --git a/test/language/expressions/object/cpn-computed-property-name-from-integer-e-notational-literal.js b/test/language/expressions/object/cpn-computed-property-name-from-integer-e-notational-literal.js new file mode 100644 index 0000000000..83c8c28917 --- /dev/null +++ b/test/language/expressions/object/cpn-computed-property-name-from-integer-e-notational-literal.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-integer-e-notational-literal.case +// - src/computed-property-names/evaluation/object-literal.template +/*--- +description: Computed property name from numeric literal (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 = { + [1]: 2 +}; + +assert.sameValue( + o[1], + 2 +); diff --git a/test/language/expressions/object/cpn-computed-property-name-from-integer-separators.js b/test/language/expressions/object/cpn-computed-property-name-from-integer-separators.js new file mode 100644 index 0000000000..7e9bf895fa --- /dev/null +++ b/test/language/expressions/object/cpn-computed-property-name-from-integer-separators.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-integer-separators.case +// - src/computed-property-names/evaluation/object-literal.template +/*--- +description: Computed property name from integer with separators (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 = { + [1_2_3_4_5_6_7_8]: 1_2_3_4_5_6_7_8 +}; + +assert.sameValue( + o[1_2_3_4_5_6_7_8], + 1_2_3_4_5_6_7_8 +); diff --git a/test/language/expressions/object/cpn-computed-property-name-from-math.js b/test/language/expressions/object/cpn-computed-property-name-from-math.js new file mode 100644 index 0000000000..7a797ec1d8 --- /dev/null +++ b/test/language/expressions/object/cpn-computed-property-name-from-math.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-math.case +// - src/computed-property-names/evaluation/object-literal.template +/*--- +description: Computed property name from math (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 = { + [1 + 2 - 3 * 4 / 5 ** 6]: 2.999232 +}; + +assert.sameValue( + o[1 + 2 - 3 * 4 / 5 ** 6], + 2.999232 +); diff --git a/test/language/expressions/object/cpn-computed-property-name-from-multiplicative-expression-div.js b/test/language/expressions/object/cpn-computed-property-name-from-multiplicative-expression-div.js new file mode 100644 index 0000000000..45deb31c62 --- /dev/null +++ b/test/language/expressions/object/cpn-computed-property-name-from-multiplicative-expression-div.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-multiplicative-expression-div.case +// - src/computed-property-names/evaluation/object-literal.template +/*--- +description: Computed property name from multiplicative expression "divide" (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 = { + [1 / 1]: 1 +}; + +assert.sameValue( + o[1 / 1], + 1 +); diff --git a/test/language/expressions/object/cpn-computed-property-name-from-multiplicative-expression-mult.js b/test/language/expressions/object/cpn-computed-property-name-from-multiplicative-expression-mult.js new file mode 100644 index 0000000000..a6d2c117e7 --- /dev/null +++ b/test/language/expressions/object/cpn-computed-property-name-from-multiplicative-expression-mult.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-multiplicative-expression-mult.case +// - src/computed-property-names/evaluation/object-literal.template +/*--- +description: Computed property name from multiplicative expression "multiply" (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 = { + [1 * 1]: 1 +}; + +assert.sameValue( + o[1 * 1], + 1 +); diff --git a/test/language/expressions/object/cpn-computed-property-name-from-numeric-literal.js b/test/language/expressions/object/cpn-computed-property-name-from-numeric-literal.js new file mode 100644 index 0000000000..26a8e55b13 --- /dev/null +++ b/test/language/expressions/object/cpn-computed-property-name-from-numeric-literal.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-numeric-literal.case +// - src/computed-property-names/evaluation/object-literal.template +/*--- +description: Computed property name from numeric literal (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 = { + [1]: 2 +}; + +assert.sameValue( + o[1], + 2 +); diff --git a/test/language/expressions/object/cpn-computed-property-name-from-string-literal.js b/test/language/expressions/object/cpn-computed-property-name-from-string-literal.js new file mode 100644 index 0000000000..36d45e147f --- /dev/null +++ b/test/language/expressions/object/cpn-computed-property-name-from-string-literal.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-string-literal.case +// - src/computed-property-names/evaluation/object-literal.template +/*--- +description: Computed property name from string literal (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 = { + ['1']: '2' +}; + +assert.sameValue( + o['1'], + '2' +); diff --git a/test/language/expressions/object/cpn-computed-property-name-from-yield-expression.js b/test/language/expressions/object/cpn-computed-property-name-from-yield-expression.js new file mode 100644 index 0000000000..25410420b9 --- /dev/null +++ b/test/language/expressions/object/cpn-computed-property-name-from-yield-expression.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-yield-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] +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 +); diff --git a/test/language/statements/class/cpn-accessors-computed-property-name-from-additive-expression-add.js b/test/language/statements/class/cpn-accessors-computed-property-name-from-additive-expression-add.js new file mode 100644 index 0000000000..0fe9308469 --- /dev/null +++ b/test/language/statements/class/cpn-accessors-computed-property-name-from-additive-expression-add.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-additive-expression-add.case +// - src/computed-property-names/evaluation/class-declaration-accessors.template +/*--- +description: Computed property name from additive expression "add" (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 [1 + 1]() { + return 2; + } + + set [1 + 1](v) { + return 2; + } + + static get [1 + 1]() { + return 2; + } + + static set [1 + 1](v) { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[1 + 1], + 2 +); +assert.sameValue( + c[1 + 1] = 2, + 2 +); + +assert.sameValue( + C[1 + 1], + 2 +); +assert.sameValue( + C[1 + 1] = 2, + 2 +); diff --git a/test/language/statements/class/cpn-accessors-computed-property-name-from-additive-expression-subtract.js b/test/language/statements/class/cpn-accessors-computed-property-name-from-additive-expression-subtract.js new file mode 100644 index 0000000000..21d62cec20 --- /dev/null +++ b/test/language/statements/class/cpn-accessors-computed-property-name-from-additive-expression-subtract.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-additive-expression-subtract.case +// - src/computed-property-names/evaluation/class-declaration-accessors.template +/*--- +description: Computed property name from additive expression "subtract" (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 [1 - 1]() { + return 0; + } + + set [1 - 1](v) { + return 0; + } + + static get [1 - 1]() { + return 0; + } + + static set [1 - 1](v) { + return 0; + } +}; + +let c = new C(); + +assert.sameValue( + c[1 - 1], + 0 +); +assert.sameValue( + c[1 - 1] = 0, + 0 +); + +assert.sameValue( + C[1 - 1], + 0 +); +assert.sameValue( + C[1 - 1] = 0, + 0 +); diff --git a/test/language/statements/class/cpn-accessors-computed-property-name-from-arrow-function-expression.js b/test/language/statements/class/cpn-accessors-computed-property-name-from-arrow-function-expression.js new file mode 100644 index 0000000000..cea789fc77 --- /dev/null +++ b/test/language/statements/class/cpn-accessors-computed-property-name-from-arrow-function-expression.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-arrow-function-expression.case +// - src/computed-property-names/evaluation/class-declaration-accessors.template +/*--- +description: Computed property name from arrow function (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 [() => { }]() { + return 1; + } + + set [() => { }](v) { + return 1; + } + + static get [() => { }]() { + return 1; + } + + static set [() => { }](v) { + return 1; + } +}; + +let c = new C(); + +assert.sameValue( + c[() => { }], + 1 +); +assert.sameValue( + c[() => { }] = 1, + 1 +); + +assert.sameValue( + C[() => { }], + 1 +); +assert.sameValue( + C[() => { }] = 1, + 1 +); diff --git a/test/language/statements/class/cpn-accessors-computed-property-name-from-assignment-expression-assignment.js b/test/language/statements/class/cpn-accessors-computed-property-name-from-assignment-expression-assignment.js new file mode 100644 index 0000000000..0e8958fd56 --- /dev/null +++ b/test/language/statements/class/cpn-accessors-computed-property-name-from-assignment-expression-assignment.js @@ -0,0 +1,77 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-assignment.case +// - src/computed-property-names/evaluation/class-declaration-accessors.template +/*--- +description: Computed property name from assignment expression (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +class C { + get [x = 1]() { + return 2; + } + + set [x = 1](v) { + return 2; + } + + static get [x = 1]() { + return 2; + } + + static set [x = 1](v) { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[x = 1], + 2 +); +assert.sameValue( + c[x = 1] = 2, + 2 +); + +assert.sameValue( + C[x = 1], + 2 +); +assert.sameValue( + C[x = 1] = 2, + 2 +); + +assert.sameValue(x, 1); diff --git a/test/language/statements/class/cpn-accessors-computed-property-name-from-assignment-expression-bitwise-or.js b/test/language/statements/class/cpn-accessors-computed-property-name-from-assignment-expression-bitwise-or.js new file mode 100644 index 0000000000..7d096ab7d5 --- /dev/null +++ b/test/language/statements/class/cpn-accessors-computed-property-name-from-assignment-expression-bitwise-or.js @@ -0,0 +1,77 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-bitwise-or.case +// - src/computed-property-names/evaluation/class-declaration-accessors.template +/*--- +description: Computed property name from assignment expression bitwise or (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +class C { + get [x |= 1]() { + return 2; + } + + set [x |= 1](v) { + return 2; + } + + static get [x |= 1]() { + return 2; + } + + static set [x |= 1](v) { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[x |= 1], + 2 +); +assert.sameValue( + c[x |= 1] = 2, + 2 +); + +assert.sameValue( + C[x |= 1], + 2 +); +assert.sameValue( + C[x |= 1] = 2, + 2 +); + +assert.sameValue(x, 1); diff --git a/test/language/statements/class/cpn-accessors-computed-property-name-from-assignment-expression-coalesce.js b/test/language/statements/class/cpn-accessors-computed-property-name-from-assignment-expression-coalesce.js new file mode 100644 index 0000000000..512d22ede3 --- /dev/null +++ b/test/language/statements/class/cpn-accessors-computed-property-name-from-assignment-expression-coalesce.js @@ -0,0 +1,77 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-coalesce.case +// - src/computed-property-names/evaluation/class-declaration-accessors.template +/*--- +description: Computed property name from assignment expression coalesce (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = null; + + +class C { + get [x ??= 1]() { + return 2; + } + + set [x ??= 1](v) { + return 2; + } + + static get [x ??= 1]() { + return 2; + } + + static set [x ??= 1](v) { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[x ??= 1], + 2 +); +assert.sameValue( + c[x ??= 1] = 2, + 2 +); + +assert.sameValue( + C[x ??= 1], + 2 +); +assert.sameValue( + C[x ??= 1] = 2, + 2 +); + +assert.sameValue(x, 1); diff --git a/test/language/statements/class/cpn-accessors-computed-property-name-from-assignment-expression-logical-and.js b/test/language/statements/class/cpn-accessors-computed-property-name-from-assignment-expression-logical-and.js new file mode 100644 index 0000000000..304b580ef1 --- /dev/null +++ b/test/language/statements/class/cpn-accessors-computed-property-name-from-assignment-expression-logical-and.js @@ -0,0 +1,77 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-logical-and.case +// - src/computed-property-names/evaluation/class-declaration-accessors.template +/*--- +description: Computed property name from assignment expression logical and (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +class C { + get [x &&= 1]() { + return 2; + } + + set [x &&= 1](v) { + return 2; + } + + static get [x &&= 1]() { + return 2; + } + + static set [x &&= 1](v) { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[x &&= 1], + 2 +); +assert.sameValue( + c[x &&= 1] = 2, + 2 +); + +assert.sameValue( + C[x &&= 1], + 2 +); +assert.sameValue( + C[x &&= 1] = 2, + 2 +); + +assert.sameValue(x, 0); diff --git a/test/language/statements/class/cpn-accessors-computed-property-name-from-assignment-expression-logical-or.js b/test/language/statements/class/cpn-accessors-computed-property-name-from-assignment-expression-logical-or.js new file mode 100644 index 0000000000..170418447f --- /dev/null +++ b/test/language/statements/class/cpn-accessors-computed-property-name-from-assignment-expression-logical-or.js @@ -0,0 +1,77 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-logical-or.case +// - src/computed-property-names/evaluation/class-declaration-accessors.template +/*--- +description: Computed property name from assignment expression logical or (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +class C { + get [x ||= 1]() { + return 2; + } + + set [x ||= 1](v) { + return 2; + } + + static get [x ||= 1]() { + return 2; + } + + static set [x ||= 1](v) { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[x ||= 1], + 2 +); +assert.sameValue( + c[x ||= 1] = 2, + 2 +); + +assert.sameValue( + C[x ||= 1], + 2 +); +assert.sameValue( + C[x ||= 1] = 2, + 2 +); + +assert.sameValue(x, 1); diff --git a/test/language/statements/class/cpn-accessors-computed-property-name-from-async-arrow-function-expression.js b/test/language/statements/class/cpn-accessors-computed-property-name-from-async-arrow-function-expression.js new file mode 100644 index 0000000000..8669bfc6a7 --- /dev/null +++ b/test/language/statements/class/cpn-accessors-computed-property-name-from-async-arrow-function-expression.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-async-arrow-function-expression.case +// - src/computed-property-names/evaluation/class-declaration-accessors.template +/*--- +description: Computed property name from function expression (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 [async () => {}]() { + return 1; + } + + set [async () => {}](v) { + return 1; + } + + static get [async () => {}]() { + return 1; + } + + static set [async () => {}](v) { + return 1; + } +}; + +let c = new C(); + +assert.sameValue( + c[async () => {}], + 1 +); +assert.sameValue( + c[async () => {}] = 1, + 1 +); + +assert.sameValue( + C[async () => {}], + 1 +); +assert.sameValue( + C[async () => {}] = 1, + 1 +); diff --git a/test/language/statements/class/cpn-accessors-computed-property-name-from-condition-expression-false.js b/test/language/statements/class/cpn-accessors-computed-property-name-from-condition-expression-false.js new file mode 100644 index 0000000000..fae29dd10e --- /dev/null +++ b/test/language/statements/class/cpn-accessors-computed-property-name-from-condition-expression-false.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-condition-expression-false.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] +flags: [generated] +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 [false ? 1 : 2]() { + return 1; + } + + set [false ? 1 : 2](v) { + return 1; + } + + static get [false ? 1 : 2]() { + return 1; + } + + static set [false ? 1 : 2](v) { + return 1; + } +}; + +let c = new C(); + +assert.sameValue( + c[false ? 1 : 2], + 1 +); +assert.sameValue( + c[false ? 1 : 2] = 1, + 1 +); + +assert.sameValue( + C[false ? 1 : 2], + 1 +); +assert.sameValue( + C[false ? 1 : 2] = 1, + 1 +); diff --git a/test/language/statements/class/cpn-accessors-computed-property-name-from-condition-expression-true.js b/test/language/statements/class/cpn-accessors-computed-property-name-from-condition-expression-true.js new file mode 100644 index 0000000000..58beaffb12 --- /dev/null +++ b/test/language/statements/class/cpn-accessors-computed-property-name-from-condition-expression-true.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-condition-expression-true.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] +flags: [generated] +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 [true ? 1 : 2]() { + return 2; + } + + set [true ? 1 : 2](v) { + return 2; + } + + static get [true ? 1 : 2]() { + return 2; + } + + static set [true ? 1 : 2](v) { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[true ? 1 : 2], + 2 +); +assert.sameValue( + c[true ? 1 : 2] = 2, + 2 +); + +assert.sameValue( + C[true ? 1 : 2], + 2 +); +assert.sameValue( + C[true ? 1 : 2] = 2, + 2 +); diff --git a/test/language/statements/class/cpn-accessors-computed-property-name-from-decimal-e-notational-literal.js b/test/language/statements/class/cpn-accessors-computed-property-name-from-decimal-e-notational-literal.js new file mode 100644 index 0000000000..e7a557044b --- /dev/null +++ b/test/language/statements/class/cpn-accessors-computed-property-name-from-decimal-e-notational-literal.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-decimal-e-notational-literal.case +// - src/computed-property-names/evaluation/class-declaration-accessors.template +/*--- +description: Computed property name from decimal e notational literal (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 [1.e1]() { + return 2; + } + + set [1.e1](v) { + return 2; + } + + static get [1.e1]() { + return 2; + } + + static set [1.e1](v) { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[1.e1], + 2 +); +assert.sameValue( + c[1.e1] = 2, + 2 +); + +assert.sameValue( + C[1.e1], + 2 +); +assert.sameValue( + C[1.e1] = 2, + 2 +); diff --git a/test/language/statements/class/cpn-accessors-computed-property-name-from-decimal-literal.js b/test/language/statements/class/cpn-accessors-computed-property-name-from-decimal-literal.js new file mode 100644 index 0000000000..38948c865e --- /dev/null +++ b/test/language/statements/class/cpn-accessors-computed-property-name-from-decimal-literal.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-decimal-literal.case +// - src/computed-property-names/evaluation/class-declaration-accessors.template +/*--- +description: Computed property name from decimal literal (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 [1.1]() { + return 2; + } + + set [1.1](v) { + return 2; + } + + static get [1.1]() { + return 2; + } + + static set [1.1](v) { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[1.1], + 2 +); +assert.sameValue( + c[1.1] = 2, + 2 +); + +assert.sameValue( + C[1.1], + 2 +); +assert.sameValue( + C[1.1] = 2, + 2 +); diff --git a/test/language/statements/class/cpn-accessors-computed-property-name-from-exponetiation-expression.js b/test/language/statements/class/cpn-accessors-computed-property-name-from-exponetiation-expression.js new file mode 100644 index 0000000000..65a4c51d1f --- /dev/null +++ b/test/language/statements/class/cpn-accessors-computed-property-name-from-exponetiation-expression.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-exponetiation-expression.case +// - src/computed-property-names/evaluation/class-declaration-accessors.template +/*--- +description: Computed property name from exponentiation expression (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 [2 ** 2]() { + return 4; + } + + set [2 ** 2](v) { + return 4; + } + + static get [2 ** 2]() { + return 4; + } + + static set [2 ** 2](v) { + return 4; + } +}; + +let c = new C(); + +assert.sameValue( + c[2 ** 2], + 4 +); +assert.sameValue( + c[2 ** 2] = 4, + 4 +); + +assert.sameValue( + C[2 ** 2], + 4 +); +assert.sameValue( + C[2 ** 2] = 4, + 4 +); diff --git a/test/language/statements/class/cpn-accessors-computed-property-name-from-expression-coalesce.js b/test/language/statements/class/cpn-accessors-computed-property-name-from-expression-coalesce.js new file mode 100644 index 0000000000..69ecc38e2b --- /dev/null +++ b/test/language/statements/class/cpn-accessors-computed-property-name-from-expression-coalesce.js @@ -0,0 +1,77 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-expression-coalesce.case +// - src/computed-property-names/evaluation/class-declaration-accessors.template +/*--- +description: Computed property name from coalesce (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x; + + +class C { + get [x ?? 1]() { + return 2; + } + + set [x ?? 1](v) { + return 2; + } + + static get [x ?? 1]() { + return 2; + } + + static set [x ?? 1](v) { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[x ?? 1], + 2 +); +assert.sameValue( + c[x ?? 1] = 2, + 2 +); + +assert.sameValue( + C[x ?? 1], + 2 +); +assert.sameValue( + C[x ?? 1] = 2, + 2 +); + +assert.sameValue(x, undefined); diff --git a/test/language/statements/class/cpn-accessors-computed-property-name-from-expression-logical-and.js b/test/language/statements/class/cpn-accessors-computed-property-name-from-expression-logical-and.js new file mode 100644 index 0000000000..ea3dfbe466 --- /dev/null +++ b/test/language/statements/class/cpn-accessors-computed-property-name-from-expression-logical-and.js @@ -0,0 +1,77 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-expression-logical-and.case +// - src/computed-property-names/evaluation/class-declaration-accessors.template +/*--- +description: Computed property name from logical and (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +class C { + get [x && 1]() { + return 2; + } + + set [x && 1](v) { + return 2; + } + + static get [x && 1]() { + return 2; + } + + static set [x && 1](v) { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[x && 1], + 2 +); +assert.sameValue( + c[x && 1] = 2, + 2 +); + +assert.sameValue( + C[x && 1], + 2 +); +assert.sameValue( + C[x && 1] = 2, + 2 +); + +assert.sameValue(x, 0); diff --git a/test/language/statements/class/cpn-accessors-computed-property-name-from-expression-logical-or.js b/test/language/statements/class/cpn-accessors-computed-property-name-from-expression-logical-or.js new file mode 100644 index 0000000000..03fa21a07c --- /dev/null +++ b/test/language/statements/class/cpn-accessors-computed-property-name-from-expression-logical-or.js @@ -0,0 +1,77 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-expression-logical-or.case +// - src/computed-property-names/evaluation/class-declaration-accessors.template +/*--- +description: Computed property name from logical or (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +class C { + get [x || 1]() { + return 2; + } + + set [x || 1](v) { + return 2; + } + + static get [x || 1]() { + return 2; + } + + static set [x || 1](v) { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[x || 1], + 2 +); +assert.sameValue( + c[x || 1] = 2, + 2 +); + +assert.sameValue( + C[x || 1], + 2 +); +assert.sameValue( + C[x || 1] = 2, + 2 +); + +assert.sameValue(x, 0); diff --git a/test/language/statements/class/cpn-accessors-computed-property-name-from-function-declaration.js b/test/language/statements/class/cpn-accessors-computed-property-name-from-function-declaration.js new file mode 100644 index 0000000000..914b6aef2b --- /dev/null +++ b/test/language/statements/class/cpn-accessors-computed-property-name-from-function-declaration.js @@ -0,0 +1,75 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-function-declaration.case +// - src/computed-property-names/evaluation/class-declaration-accessors.template +/*--- +description: Computed property name from function (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 ] +---*/ +function f() {} + + +class C { + get [f()]() { + return 1; + } + + set [f()](v) { + return 1; + } + + static get [f()]() { + return 1; + } + + static set [f()](v) { + return 1; + } +}; + +let c = new C(); + +assert.sameValue( + c[f()], + 1 +); +assert.sameValue( + c[f()] = 1, + 1 +); + +assert.sameValue( + C[f()], + 1 +); +assert.sameValue( + C[f()] = 1, + 1 +); diff --git a/test/language/statements/class/cpn-accessors-computed-property-name-from-function-expression.js b/test/language/statements/class/cpn-accessors-computed-property-name-from-function-expression.js new file mode 100644 index 0000000000..7a341425c7 --- /dev/null +++ b/test/language/statements/class/cpn-accessors-computed-property-name-from-function-expression.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-function-expression.case +// - src/computed-property-names/evaluation/class-declaration-accessors.template +/*--- +description: Computed property name from function expression (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 [function () {}]() { + return 1; + } + + set [function () {}](v) { + return 1; + } + + static get [function () {}]() { + return 1; + } + + static set [function () {}](v) { + return 1; + } +}; + +let c = new C(); + +assert.sameValue( + c[function () {}], + 1 +); +assert.sameValue( + c[function () {}] = 1, + 1 +); + +assert.sameValue( + C[function () {}], + 1 +); +assert.sameValue( + C[function () {}] = 1, + 1 +); diff --git a/test/language/statements/class/cpn-accessors-computed-property-name-from-generator-function-declaration.js b/test/language/statements/class/cpn-accessors-computed-property-name-from-generator-function-declaration.js new file mode 100644 index 0000000000..abbfd72af8 --- /dev/null +++ b/test/language/statements/class/cpn-accessors-computed-property-name-from-generator-function-declaration.js @@ -0,0 +1,75 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-generator-function-declaration.case +// - src/computed-property-names/evaluation/class-declaration-accessors.template +/*--- +description: Computed property name from generator function (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 ] +---*/ +function * g() { return 1; } + + +class C { + get [g()]() { + return 1; + } + + set [g()](v) { + return 1; + } + + static get [g()]() { + return 1; + } + + static set [g()](v) { + return 1; + } +}; + +let c = new C(); + +assert.sameValue( + c[g()], + 1 +); +assert.sameValue( + c[g()] = 1, + 1 +); + +assert.sameValue( + C[g()], + 1 +); +assert.sameValue( + C[g()] = 1, + 1 +); diff --git a/test/language/statements/class/cpn-accessors-computed-property-name-from-identifier.js b/test/language/statements/class/cpn-accessors-computed-property-name-from-identifier.js new file mode 100644 index 0000000000..3cd00dc04d --- /dev/null +++ b/test/language/statements/class/cpn-accessors-computed-property-name-from-identifier.js @@ -0,0 +1,76 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-identifier.case +// - src/computed-property-names/evaluation/class-declaration-accessors.template +/*--- +description: Computed property name from string literal (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 1; + + + +class C { + get [x]() { + return '2'; + } + + set [x](v) { + return '2'; + } + + static get [x]() { + return '2'; + } + + static set [x](v) { + return '2'; + } +}; + +let c = new C(); + +assert.sameValue( + c[x], + '2' +); +assert.sameValue( + c[x] = '2', + '2' +); + +assert.sameValue( + C[x], + '2' +); +assert.sameValue( + C[x] = '2', + '2' +); diff --git a/test/language/statements/class/cpn-accessors-computed-property-name-from-integer-e-notational-literal.js b/test/language/statements/class/cpn-accessors-computed-property-name-from-integer-e-notational-literal.js new file mode 100644 index 0000000000..19639a17ea --- /dev/null +++ b/test/language/statements/class/cpn-accessors-computed-property-name-from-integer-e-notational-literal.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-integer-e-notational-literal.case +// - src/computed-property-names/evaluation/class-declaration-accessors.template +/*--- +description: Computed property name from numeric literal (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 [1]() { + return 2; + } + + set [1](v) { + return 2; + } + + static get [1]() { + return 2; + } + + static set [1](v) { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[1], + 2 +); +assert.sameValue( + c[1] = 2, + 2 +); + +assert.sameValue( + C[1], + 2 +); +assert.sameValue( + C[1] = 2, + 2 +); diff --git a/test/language/statements/class/cpn-accessors-computed-property-name-from-integer-separators.js b/test/language/statements/class/cpn-accessors-computed-property-name-from-integer-separators.js new file mode 100644 index 0000000000..d5d6389388 --- /dev/null +++ b/test/language/statements/class/cpn-accessors-computed-property-name-from-integer-separators.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-integer-separators.case +// - src/computed-property-names/evaluation/class-declaration-accessors.template +/*--- +description: Computed property name from integer with separators (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 [1_2_3_4_5_6_7_8]() { + return 1_2_3_4_5_6_7_8; + } + + set [1_2_3_4_5_6_7_8](v) { + return 1_2_3_4_5_6_7_8; + } + + static get [1_2_3_4_5_6_7_8]() { + return 1_2_3_4_5_6_7_8; + } + + static set [1_2_3_4_5_6_7_8](v) { + return 1_2_3_4_5_6_7_8; + } +}; + +let c = new C(); + +assert.sameValue( + c[1_2_3_4_5_6_7_8], + 1_2_3_4_5_6_7_8 +); +assert.sameValue( + c[1_2_3_4_5_6_7_8] = 1_2_3_4_5_6_7_8, + 1_2_3_4_5_6_7_8 +); + +assert.sameValue( + C[1_2_3_4_5_6_7_8], + 1_2_3_4_5_6_7_8 +); +assert.sameValue( + C[1_2_3_4_5_6_7_8] = 1_2_3_4_5_6_7_8, + 1_2_3_4_5_6_7_8 +); diff --git a/test/language/statements/class/cpn-accessors-computed-property-name-from-math.js b/test/language/statements/class/cpn-accessors-computed-property-name-from-math.js new file mode 100644 index 0000000000..e41060eb0c --- /dev/null +++ b/test/language/statements/class/cpn-accessors-computed-property-name-from-math.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-math.case +// - src/computed-property-names/evaluation/class-declaration-accessors.template +/*--- +description: Computed property name from math (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 [1 + 2 - 3 * 4 / 5 ** 6]() { + return 2.999232; + } + + set [1 + 2 - 3 * 4 / 5 ** 6](v) { + return 2.999232; + } + + static get [1 + 2 - 3 * 4 / 5 ** 6]() { + return 2.999232; + } + + static set [1 + 2 - 3 * 4 / 5 ** 6](v) { + return 2.999232; + } +}; + +let c = new C(); + +assert.sameValue( + c[1 + 2 - 3 * 4 / 5 ** 6], + 2.999232 +); +assert.sameValue( + c[1 + 2 - 3 * 4 / 5 ** 6] = 2.999232, + 2.999232 +); + +assert.sameValue( + C[1 + 2 - 3 * 4 / 5 ** 6], + 2.999232 +); +assert.sameValue( + C[1 + 2 - 3 * 4 / 5 ** 6] = 2.999232, + 2.999232 +); diff --git a/test/language/statements/class/cpn-accessors-computed-property-name-from-multiplicative-expression-div.js b/test/language/statements/class/cpn-accessors-computed-property-name-from-multiplicative-expression-div.js new file mode 100644 index 0000000000..98f72ebe4a --- /dev/null +++ b/test/language/statements/class/cpn-accessors-computed-property-name-from-multiplicative-expression-div.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-multiplicative-expression-div.case +// - src/computed-property-names/evaluation/class-declaration-accessors.template +/*--- +description: Computed property name from multiplicative expression "divide" (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 [1 / 1]() { + return 1; + } + + set [1 / 1](v) { + return 1; + } + + static get [1 / 1]() { + return 1; + } + + static set [1 / 1](v) { + return 1; + } +}; + +let c = new C(); + +assert.sameValue( + c[1 / 1], + 1 +); +assert.sameValue( + c[1 / 1] = 1, + 1 +); + +assert.sameValue( + C[1 / 1], + 1 +); +assert.sameValue( + C[1 / 1] = 1, + 1 +); diff --git a/test/language/statements/class/cpn-accessors-computed-property-name-from-multiplicative-expression-mult.js b/test/language/statements/class/cpn-accessors-computed-property-name-from-multiplicative-expression-mult.js new file mode 100644 index 0000000000..33b2d008fd --- /dev/null +++ b/test/language/statements/class/cpn-accessors-computed-property-name-from-multiplicative-expression-mult.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-multiplicative-expression-mult.case +// - src/computed-property-names/evaluation/class-declaration-accessors.template +/*--- +description: Computed property name from multiplicative expression "multiply" (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 [1 * 1]() { + return 1; + } + + set [1 * 1](v) { + return 1; + } + + static get [1 * 1]() { + return 1; + } + + static set [1 * 1](v) { + return 1; + } +}; + +let c = new C(); + +assert.sameValue( + c[1 * 1], + 1 +); +assert.sameValue( + c[1 * 1] = 1, + 1 +); + +assert.sameValue( + C[1 * 1], + 1 +); +assert.sameValue( + C[1 * 1] = 1, + 1 +); diff --git a/test/language/statements/class/cpn-accessors-computed-property-name-from-numeric-literal.js b/test/language/statements/class/cpn-accessors-computed-property-name-from-numeric-literal.js new file mode 100644 index 0000000000..44cf51cd43 --- /dev/null +++ b/test/language/statements/class/cpn-accessors-computed-property-name-from-numeric-literal.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-numeric-literal.case +// - src/computed-property-names/evaluation/class-declaration-accessors.template +/*--- +description: Computed property name from numeric literal (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 [1]() { + return 2; + } + + set [1](v) { + return 2; + } + + static get [1]() { + return 2; + } + + static set [1](v) { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[1], + 2 +); +assert.sameValue( + c[1] = 2, + 2 +); + +assert.sameValue( + C[1], + 2 +); +assert.sameValue( + C[1] = 2, + 2 +); diff --git a/test/language/statements/class/cpn-accessors-computed-property-name-from-string-literal.js b/test/language/statements/class/cpn-accessors-computed-property-name-from-string-literal.js new file mode 100644 index 0000000000..5652546d53 --- /dev/null +++ b/test/language/statements/class/cpn-accessors-computed-property-name-from-string-literal.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-string-literal.case +// - src/computed-property-names/evaluation/class-declaration-accessors.template +/*--- +description: Computed property name from string literal (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 ['1']() { + return '2'; + } + + set ['1'](v) { + return '2'; + } + + static get ['1']() { + return '2'; + } + + static set ['1'](v) { + return '2'; + } +}; + +let c = new C(); + +assert.sameValue( + c['1'], + '2' +); +assert.sameValue( + c['1'] = '2', + '2' +); + +assert.sameValue( + C['1'], + '2' +); +assert.sameValue( + C['1'] = '2', + '2' +); diff --git a/test/language/statements/class/cpn-accessors-computed-property-name-from-yield-expression.js b/test/language/statements/class/cpn-accessors-computed-property-name-from-yield-expression.js new file mode 100644 index 0000000000..8bba049ffb --- /dev/null +++ b/test/language/statements/class/cpn-accessors-computed-property-name-from-yield-expression.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-yield-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] +flags: [generated] +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 [true ? 1 : 2]() { + return 2; + } + + set [true ? 1 : 2](v) { + return 2; + } + + static get [true ? 1 : 2]() { + return 2; + } + + static set [true ? 1 : 2](v) { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[true ? 1 : 2], + 2 +); +assert.sameValue( + c[true ? 1 : 2] = 2, + 2 +); + +assert.sameValue( + C[true ? 1 : 2], + 2 +); +assert.sameValue( + C[true ? 1 : 2] = 2, + 2 +); diff --git a/test/language/statements/class/cpn-computed-property-name-from-additive-expression-add.js b/test/language/statements/class/cpn-computed-property-name-from-additive-expression-add.js new file mode 100644 index 0000000000..e80de8167b --- /dev/null +++ b/test/language/statements/class/cpn-computed-property-name-from-additive-expression-add.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-additive-expression-add.case +// - src/computed-property-names/evaluation/class-declaration.template +/*--- +description: Computed property name from additive expression "add" (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1 + 1]() { + return 2; + } + static [1 + 1]() { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[1 + 1](), + 2 +); +assert.sameValue( + C[1 + 1](), + 2 +); diff --git a/test/language/statements/class/cpn-computed-property-name-from-additive-expression-subtract.js b/test/language/statements/class/cpn-computed-property-name-from-additive-expression-subtract.js new file mode 100644 index 0000000000..8f9b8f897c --- /dev/null +++ b/test/language/statements/class/cpn-computed-property-name-from-additive-expression-subtract.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-additive-expression-subtract.case +// - src/computed-property-names/evaluation/class-declaration.template +/*--- +description: Computed property name from additive expression "subtract" (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1 - 1]() { + return 0; + } + static [1 - 1]() { + return 0; + } +}; + +let c = new C(); + +assert.sameValue( + c[1 - 1](), + 0 +); +assert.sameValue( + C[1 - 1](), + 0 +); diff --git a/test/language/statements/class/cpn-computed-property-name-from-arrow-function-expression.js b/test/language/statements/class/cpn-computed-property-name-from-arrow-function-expression.js new file mode 100644 index 0000000000..328ec03fc4 --- /dev/null +++ b/test/language/statements/class/cpn-computed-property-name-from-arrow-function-expression.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-arrow-function-expression.case +// - src/computed-property-names/evaluation/class-declaration.template +/*--- +description: Computed property name from arrow function (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [() => { }]() { + return 1; + } + static [() => { }]() { + return 1; + } +}; + +let c = new C(); + +assert.sameValue( + c[() => { }](), + 1 +); +assert.sameValue( + C[() => { }](), + 1 +); diff --git a/test/language/statements/class/cpn-computed-property-name-from-assignment-expression-assignment.js b/test/language/statements/class/cpn-computed-property-name-from-assignment-expression-assignment.js new file mode 100644 index 0000000000..b9ed222915 --- /dev/null +++ b/test/language/statements/class/cpn-computed-property-name-from-assignment-expression-assignment.js @@ -0,0 +1,59 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-assignment.case +// - src/computed-property-names/evaluation/class-declaration.template +/*--- +description: Computed property name from assignment expression (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +class C { + [x = 1]() { + return 2; + } + static [x = 1]() { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[x = 1](), + 2 +); +assert.sameValue( + C[x = 1](), + 2 +); + +assert.sameValue(x, 1); diff --git a/test/language/statements/class/cpn-computed-property-name-from-assignment-expression-bitwise-or.js b/test/language/statements/class/cpn-computed-property-name-from-assignment-expression-bitwise-or.js new file mode 100644 index 0000000000..a385b5c379 --- /dev/null +++ b/test/language/statements/class/cpn-computed-property-name-from-assignment-expression-bitwise-or.js @@ -0,0 +1,59 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-bitwise-or.case +// - src/computed-property-names/evaluation/class-declaration.template +/*--- +description: Computed property name from assignment expression bitwise or (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +class C { + [x |= 1]() { + return 2; + } + static [x |= 1]() { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[x |= 1](), + 2 +); +assert.sameValue( + C[x |= 1](), + 2 +); + +assert.sameValue(x, 1); diff --git a/test/language/statements/class/cpn-computed-property-name-from-assignment-expression-coalesce.js b/test/language/statements/class/cpn-computed-property-name-from-assignment-expression-coalesce.js new file mode 100644 index 0000000000..cd285da405 --- /dev/null +++ b/test/language/statements/class/cpn-computed-property-name-from-assignment-expression-coalesce.js @@ -0,0 +1,59 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-coalesce.case +// - src/computed-property-names/evaluation/class-declaration.template +/*--- +description: Computed property name from assignment expression coalesce (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = null; + + +class C { + [x ??= 1]() { + return 2; + } + static [x ??= 1]() { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[x ??= 1](), + 2 +); +assert.sameValue( + C[x ??= 1](), + 2 +); + +assert.sameValue(x, 1); diff --git a/test/language/statements/class/cpn-computed-property-name-from-assignment-expression-logical-and.js b/test/language/statements/class/cpn-computed-property-name-from-assignment-expression-logical-and.js new file mode 100644 index 0000000000..556a70bf54 --- /dev/null +++ b/test/language/statements/class/cpn-computed-property-name-from-assignment-expression-logical-and.js @@ -0,0 +1,59 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-logical-and.case +// - src/computed-property-names/evaluation/class-declaration.template +/*--- +description: Computed property name from assignment expression logical and (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +class C { + [x &&= 1]() { + return 2; + } + static [x &&= 1]() { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[x &&= 1](), + 2 +); +assert.sameValue( + C[x &&= 1](), + 2 +); + +assert.sameValue(x, 0); diff --git a/test/language/statements/class/cpn-computed-property-name-from-assignment-expression-logical-or.js b/test/language/statements/class/cpn-computed-property-name-from-assignment-expression-logical-or.js new file mode 100644 index 0000000000..f2b6872895 --- /dev/null +++ b/test/language/statements/class/cpn-computed-property-name-from-assignment-expression-logical-or.js @@ -0,0 +1,59 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-logical-or.case +// - src/computed-property-names/evaluation/class-declaration.template +/*--- +description: Computed property name from assignment expression logical or (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +class C { + [x ||= 1]() { + return 2; + } + static [x ||= 1]() { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[x ||= 1](), + 2 +); +assert.sameValue( + C[x ||= 1](), + 2 +); + +assert.sameValue(x, 1); diff --git a/test/language/statements/class/cpn-computed-property-name-from-async-arrow-function-expression.js b/test/language/statements/class/cpn-computed-property-name-from-async-arrow-function-expression.js new file mode 100644 index 0000000000..850f3d423f --- /dev/null +++ b/test/language/statements/class/cpn-computed-property-name-from-async-arrow-function-expression.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-async-arrow-function-expression.case +// - src/computed-property-names/evaluation/class-declaration.template +/*--- +description: Computed property name from function expression (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [async () => {}]() { + return 1; + } + static [async () => {}]() { + return 1; + } +}; + +let c = new C(); + +assert.sameValue( + c[async () => {}](), + 1 +); +assert.sameValue( + C[async () => {}](), + 1 +); diff --git a/test/language/statements/class/cpn-computed-property-name-from-condition-expression-false.js b/test/language/statements/class/cpn-computed-property-name-from-condition-expression-false.js new file mode 100644 index 0000000000..05883ef58e --- /dev/null +++ b/test/language/statements/class/cpn-computed-property-name-from-condition-expression-false.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-condition-expression-false.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] +flags: [generated] +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 { + [false ? 1 : 2]() { + return 1; + } + static [false ? 1 : 2]() { + return 1; + } +}; + +let c = new C(); + +assert.sameValue( + c[false ? 1 : 2](), + 1 +); +assert.sameValue( + C[false ? 1 : 2](), + 1 +); diff --git a/test/language/statements/class/cpn-computed-property-name-from-condition-expression-true.js b/test/language/statements/class/cpn-computed-property-name-from-condition-expression-true.js new file mode 100644 index 0000000000..a16b3edf0e --- /dev/null +++ b/test/language/statements/class/cpn-computed-property-name-from-condition-expression-true.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-condition-expression-true.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] +flags: [generated] +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 { + [true ? 1 : 2]() { + return 2; + } + static [true ? 1 : 2]() { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[true ? 1 : 2](), + 2 +); +assert.sameValue( + C[true ? 1 : 2](), + 2 +); diff --git a/test/language/statements/class/cpn-computed-property-name-from-decimal-e-notational-literal.js b/test/language/statements/class/cpn-computed-property-name-from-decimal-e-notational-literal.js new file mode 100644 index 0000000000..0c36953548 --- /dev/null +++ b/test/language/statements/class/cpn-computed-property-name-from-decimal-e-notational-literal.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-decimal-e-notational-literal.case +// - src/computed-property-names/evaluation/class-declaration.template +/*--- +description: Computed property name from decimal e notational literal (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1.e1]() { + return 2; + } + static [1.e1]() { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[1.e1](), + 2 +); +assert.sameValue( + C[1.e1](), + 2 +); diff --git a/test/language/statements/class/cpn-computed-property-name-from-decimal-literal.js b/test/language/statements/class/cpn-computed-property-name-from-decimal-literal.js new file mode 100644 index 0000000000..6466646541 --- /dev/null +++ b/test/language/statements/class/cpn-computed-property-name-from-decimal-literal.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-decimal-literal.case +// - src/computed-property-names/evaluation/class-declaration.template +/*--- +description: Computed property name from decimal literal (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1.1]() { + return 2; + } + static [1.1]() { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[1.1](), + 2 +); +assert.sameValue( + C[1.1](), + 2 +); diff --git a/test/language/statements/class/cpn-computed-property-name-from-exponetiation-expression.js b/test/language/statements/class/cpn-computed-property-name-from-exponetiation-expression.js new file mode 100644 index 0000000000..49143fabe4 --- /dev/null +++ b/test/language/statements/class/cpn-computed-property-name-from-exponetiation-expression.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-exponetiation-expression.case +// - src/computed-property-names/evaluation/class-declaration.template +/*--- +description: Computed property name from exponentiation expression (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [2 ** 2]() { + return 4; + } + static [2 ** 2]() { + return 4; + } +}; + +let c = new C(); + +assert.sameValue( + c[2 ** 2](), + 4 +); +assert.sameValue( + C[2 ** 2](), + 4 +); diff --git a/test/language/statements/class/cpn-computed-property-name-from-expression-coalesce.js b/test/language/statements/class/cpn-computed-property-name-from-expression-coalesce.js new file mode 100644 index 0000000000..c2e9baac57 --- /dev/null +++ b/test/language/statements/class/cpn-computed-property-name-from-expression-coalesce.js @@ -0,0 +1,59 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-expression-coalesce.case +// - src/computed-property-names/evaluation/class-declaration.template +/*--- +description: Computed property name from coalesce (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x; + + +class C { + [x ?? 1]() { + return 2; + } + static [x ?? 1]() { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[x ?? 1](), + 2 +); +assert.sameValue( + C[x ?? 1](), + 2 +); + +assert.sameValue(x, undefined); diff --git a/test/language/statements/class/cpn-computed-property-name-from-expression-logical-and.js b/test/language/statements/class/cpn-computed-property-name-from-expression-logical-and.js new file mode 100644 index 0000000000..414bc4afa7 --- /dev/null +++ b/test/language/statements/class/cpn-computed-property-name-from-expression-logical-and.js @@ -0,0 +1,59 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-expression-logical-and.case +// - src/computed-property-names/evaluation/class-declaration.template +/*--- +description: Computed property name from logical and (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +class C { + [x && 1]() { + return 2; + } + static [x && 1]() { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[x && 1](), + 2 +); +assert.sameValue( + C[x && 1](), + 2 +); + +assert.sameValue(x, 0); diff --git a/test/language/statements/class/cpn-computed-property-name-from-expression-logical-or.js b/test/language/statements/class/cpn-computed-property-name-from-expression-logical-or.js new file mode 100644 index 0000000000..974f6db9c4 --- /dev/null +++ b/test/language/statements/class/cpn-computed-property-name-from-expression-logical-or.js @@ -0,0 +1,59 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-expression-logical-or.case +// - src/computed-property-names/evaluation/class-declaration.template +/*--- +description: Computed property name from logical or (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +class C { + [x || 1]() { + return 2; + } + static [x || 1]() { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[x || 1](), + 2 +); +assert.sameValue( + C[x || 1](), + 2 +); + +assert.sameValue(x, 0); diff --git a/test/language/statements/class/cpn-computed-property-name-from-function-declaration.js b/test/language/statements/class/cpn-computed-property-name-from-function-declaration.js new file mode 100644 index 0000000000..c53df59518 --- /dev/null +++ b/test/language/statements/class/cpn-computed-property-name-from-function-declaration.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-function-declaration.case +// - src/computed-property-names/evaluation/class-declaration.template +/*--- +description: Computed property name from function (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 ] +---*/ +function f() {} + + +class C { + [f()]() { + return 1; + } + static [f()]() { + return 1; + } +}; + +let c = new C(); + +assert.sameValue( + c[f()](), + 1 +); +assert.sameValue( + C[f()](), + 1 +); diff --git a/test/language/statements/class/cpn-computed-property-name-from-function-expression.js b/test/language/statements/class/cpn-computed-property-name-from-function-expression.js new file mode 100644 index 0000000000..a1c4bc599f --- /dev/null +++ b/test/language/statements/class/cpn-computed-property-name-from-function-expression.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-function-expression.case +// - src/computed-property-names/evaluation/class-declaration.template +/*--- +description: Computed property name from function expression (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [function () {}]() { + return 1; + } + static [function () {}]() { + return 1; + } +}; + +let c = new C(); + +assert.sameValue( + c[function () {}](), + 1 +); +assert.sameValue( + C[function () {}](), + 1 +); diff --git a/test/language/statements/class/cpn-computed-property-name-from-generator-function-declaration.js b/test/language/statements/class/cpn-computed-property-name-from-generator-function-declaration.js new file mode 100644 index 0000000000..bd42bdfa15 --- /dev/null +++ b/test/language/statements/class/cpn-computed-property-name-from-generator-function-declaration.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-generator-function-declaration.case +// - src/computed-property-names/evaluation/class-declaration.template +/*--- +description: Computed property name from generator function (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 ] +---*/ +function * g() { return 1; } + + +class C { + [g()]() { + return 1; + } + static [g()]() { + return 1; + } +}; + +let c = new C(); + +assert.sameValue( + c[g()](), + 1 +); +assert.sameValue( + C[g()](), + 1 +); diff --git a/test/language/statements/class/cpn-computed-property-name-from-identifier.js b/test/language/statements/class/cpn-computed-property-name-from-identifier.js new file mode 100644 index 0000000000..71bdd85784 --- /dev/null +++ b/test/language/statements/class/cpn-computed-property-name-from-identifier.js @@ -0,0 +1,58 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-identifier.case +// - src/computed-property-names/evaluation/class-declaration.template +/*--- +description: Computed property name from string literal (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 1; + + + +class C { + [x]() { + return '2'; + } + static [x]() { + return '2'; + } +}; + +let c = new C(); + +assert.sameValue( + c[x](), + '2' +); +assert.sameValue( + C[x](), + '2' +); diff --git a/test/language/statements/class/cpn-computed-property-name-from-integer-e-notational-literal.js b/test/language/statements/class/cpn-computed-property-name-from-integer-e-notational-literal.js new file mode 100644 index 0000000000..85f5b4a6c0 --- /dev/null +++ b/test/language/statements/class/cpn-computed-property-name-from-integer-e-notational-literal.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-integer-e-notational-literal.case +// - src/computed-property-names/evaluation/class-declaration.template +/*--- +description: Computed property name from numeric literal (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1]() { + return 2; + } + static [1]() { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[1](), + 2 +); +assert.sameValue( + C[1](), + 2 +); diff --git a/test/language/statements/class/cpn-computed-property-name-from-integer-separators.js b/test/language/statements/class/cpn-computed-property-name-from-integer-separators.js new file mode 100644 index 0000000000..d142025592 --- /dev/null +++ b/test/language/statements/class/cpn-computed-property-name-from-integer-separators.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-integer-separators.case +// - src/computed-property-names/evaluation/class-declaration.template +/*--- +description: Computed property name from integer with separators (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1_2_3_4_5_6_7_8]() { + return 1_2_3_4_5_6_7_8; + } + static [1_2_3_4_5_6_7_8]() { + return 1_2_3_4_5_6_7_8; + } +}; + +let c = new C(); + +assert.sameValue( + c[1_2_3_4_5_6_7_8](), + 1_2_3_4_5_6_7_8 +); +assert.sameValue( + C[1_2_3_4_5_6_7_8](), + 1_2_3_4_5_6_7_8 +); diff --git a/test/language/statements/class/cpn-computed-property-name-from-math.js b/test/language/statements/class/cpn-computed-property-name-from-math.js new file mode 100644 index 0000000000..0e119785cf --- /dev/null +++ b/test/language/statements/class/cpn-computed-property-name-from-math.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-math.case +// - src/computed-property-names/evaluation/class-declaration.template +/*--- +description: Computed property name from math (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1 + 2 - 3 * 4 / 5 ** 6]() { + return 2.999232; + } + static [1 + 2 - 3 * 4 / 5 ** 6]() { + return 2.999232; + } +}; + +let c = new C(); + +assert.sameValue( + c[1 + 2 - 3 * 4 / 5 ** 6](), + 2.999232 +); +assert.sameValue( + C[1 + 2 - 3 * 4 / 5 ** 6](), + 2.999232 +); diff --git a/test/language/statements/class/cpn-computed-property-name-from-multiplicative-expression-div.js b/test/language/statements/class/cpn-computed-property-name-from-multiplicative-expression-div.js new file mode 100644 index 0000000000..c36cf853c7 --- /dev/null +++ b/test/language/statements/class/cpn-computed-property-name-from-multiplicative-expression-div.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-multiplicative-expression-div.case +// - src/computed-property-names/evaluation/class-declaration.template +/*--- +description: Computed property name from multiplicative expression "divide" (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1 / 1]() { + return 1; + } + static [1 / 1]() { + return 1; + } +}; + +let c = new C(); + +assert.sameValue( + c[1 / 1](), + 1 +); +assert.sameValue( + C[1 / 1](), + 1 +); diff --git a/test/language/statements/class/cpn-computed-property-name-from-multiplicative-expression-mult.js b/test/language/statements/class/cpn-computed-property-name-from-multiplicative-expression-mult.js new file mode 100644 index 0000000000..dc1cad768e --- /dev/null +++ b/test/language/statements/class/cpn-computed-property-name-from-multiplicative-expression-mult.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-multiplicative-expression-mult.case +// - src/computed-property-names/evaluation/class-declaration.template +/*--- +description: Computed property name from multiplicative expression "multiply" (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1 * 1]() { + return 1; + } + static [1 * 1]() { + return 1; + } +}; + +let c = new C(); + +assert.sameValue( + c[1 * 1](), + 1 +); +assert.sameValue( + C[1 * 1](), + 1 +); diff --git a/test/language/statements/class/cpn-computed-property-name-from-numeric-literal.js b/test/language/statements/class/cpn-computed-property-name-from-numeric-literal.js new file mode 100644 index 0000000000..a15baec258 --- /dev/null +++ b/test/language/statements/class/cpn-computed-property-name-from-numeric-literal.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-numeric-literal.case +// - src/computed-property-names/evaluation/class-declaration.template +/*--- +description: Computed property name from numeric literal (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1]() { + return 2; + } + static [1]() { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[1](), + 2 +); +assert.sameValue( + C[1](), + 2 +); diff --git a/test/language/statements/class/cpn-computed-property-name-from-string-literal.js b/test/language/statements/class/cpn-computed-property-name-from-string-literal.js new file mode 100644 index 0000000000..7f082228b7 --- /dev/null +++ b/test/language/statements/class/cpn-computed-property-name-from-string-literal.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-string-literal.case +// - src/computed-property-names/evaluation/class-declaration.template +/*--- +description: Computed property name from string literal (ComputedPropertyName in ClassDeclaration) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + ['1']() { + return '2'; + } + static ['1']() { + return '2'; + } +}; + +let c = new C(); + +assert.sameValue( + c['1'](), + '2' +); +assert.sameValue( + C['1'](), + '2' +); diff --git a/test/language/statements/class/cpn-computed-property-name-from-yield-expression.js b/test/language/statements/class/cpn-computed-property-name-from-yield-expression.js new file mode 100644 index 0000000000..fba6c71868 --- /dev/null +++ b/test/language/statements/class/cpn-computed-property-name-from-yield-expression.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-yield-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] +flags: [generated] +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 { + [true ? 1 : 2]() { + return 2; + } + static [true ? 1 : 2]() { + return 2; + } +}; + +let c = new C(); + +assert.sameValue( + c[true ? 1 : 2](), + 2 +); +assert.sameValue( + C[true ? 1 : 2](), + 2 +); diff --git a/test/language/statements/class/cpn-fields-computed-property-name-from-additive-expression-add.js b/test/language/statements/class/cpn-fields-computed-property-name-from-additive-expression-add.js new file mode 100644 index 0000000000..45315068e4 --- /dev/null +++ b/test/language/statements/class/cpn-fields-computed-property-name-from-additive-expression-add.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-additive-expression-add.case +// - src/computed-property-names/evaluation/class-declaration-fields.template +/*--- +description: Computed property name from additive expression "add" (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1 + 1] = 2; + + static [1 + 1] = 2; +}; + +let c = new C(); + +assert.sameValue( + c[1 + 1], + 2 +); +assert.sameValue( + C[1 + 1], + 2 +); diff --git a/test/language/statements/class/cpn-fields-computed-property-name-from-additive-expression-subtract.js b/test/language/statements/class/cpn-fields-computed-property-name-from-additive-expression-subtract.js new file mode 100644 index 0000000000..59dfe1e5c7 --- /dev/null +++ b/test/language/statements/class/cpn-fields-computed-property-name-from-additive-expression-subtract.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-additive-expression-subtract.case +// - src/computed-property-names/evaluation/class-declaration-fields.template +/*--- +description: Computed property name from additive expression "subtract" (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1 - 1] = 0; + + static [1 - 1] = 0; +}; + +let c = new C(); + +assert.sameValue( + c[1 - 1], + 0 +); +assert.sameValue( + C[1 - 1], + 0 +); diff --git a/test/language/statements/class/cpn-fields-computed-property-name-from-arrow-function-expression.js b/test/language/statements/class/cpn-fields-computed-property-name-from-arrow-function-expression.js new file mode 100644 index 0000000000..7210909ee4 --- /dev/null +++ b/test/language/statements/class/cpn-fields-computed-property-name-from-arrow-function-expression.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-arrow-function-expression.case +// - src/computed-property-names/evaluation/class-declaration-fields.template +/*--- +description: Computed property name from arrow function (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [() => { }] = 1; + + static [() => { }] = 1; +}; + +let c = new C(); + +assert.sameValue( + c[() => { }], + 1 +); +assert.sameValue( + C[() => { }], + 1 +); diff --git a/test/language/statements/class/cpn-fields-computed-property-name-from-assignment-expression-assignment.js b/test/language/statements/class/cpn-fields-computed-property-name-from-assignment-expression-assignment.js new file mode 100644 index 0000000000..bb0f7b745f --- /dev/null +++ b/test/language/statements/class/cpn-fields-computed-property-name-from-assignment-expression-assignment.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-assignment.case +// - src/computed-property-names/evaluation/class-declaration-fields.template +/*--- +description: Computed property name from assignment expression (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +let C = class { + [x = 1] = 2; + + static [x = 1] = 2; +}; + +let c = new C(); + +assert.sameValue( + c[x = 1], + 2 +); +assert.sameValue( + C[x = 1], + 2 +); + +assert.sameValue(x, 1); diff --git a/test/language/statements/class/cpn-fields-computed-property-name-from-assignment-expression-bitwise-or.js b/test/language/statements/class/cpn-fields-computed-property-name-from-assignment-expression-bitwise-or.js new file mode 100644 index 0000000000..f63fbe6c25 --- /dev/null +++ b/test/language/statements/class/cpn-fields-computed-property-name-from-assignment-expression-bitwise-or.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-bitwise-or.case +// - src/computed-property-names/evaluation/class-declaration-fields.template +/*--- +description: Computed property name from assignment expression bitwise or (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +let C = class { + [x |= 1] = 2; + + static [x |= 1] = 2; +}; + +let c = new C(); + +assert.sameValue( + c[x |= 1], + 2 +); +assert.sameValue( + C[x |= 1], + 2 +); + +assert.sameValue(x, 1); diff --git a/test/language/statements/class/cpn-fields-computed-property-name-from-assignment-expression-coalesce.js b/test/language/statements/class/cpn-fields-computed-property-name-from-assignment-expression-coalesce.js new file mode 100644 index 0000000000..3c26df9839 --- /dev/null +++ b/test/language/statements/class/cpn-fields-computed-property-name-from-assignment-expression-coalesce.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-coalesce.case +// - src/computed-property-names/evaluation/class-declaration-fields.template +/*--- +description: Computed property name from assignment expression coalesce (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = null; + + +let C = class { + [x ??= 1] = 2; + + static [x ??= 1] = 2; +}; + +let c = new C(); + +assert.sameValue( + c[x ??= 1], + 2 +); +assert.sameValue( + C[x ??= 1], + 2 +); + +assert.sameValue(x, 1); diff --git a/test/language/statements/class/cpn-fields-computed-property-name-from-assignment-expression-logical-and.js b/test/language/statements/class/cpn-fields-computed-property-name-from-assignment-expression-logical-and.js new file mode 100644 index 0000000000..29c9914257 --- /dev/null +++ b/test/language/statements/class/cpn-fields-computed-property-name-from-assignment-expression-logical-and.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-logical-and.case +// - src/computed-property-names/evaluation/class-declaration-fields.template +/*--- +description: Computed property name from assignment expression logical and (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +let C = class { + [x &&= 1] = 2; + + static [x &&= 1] = 2; +}; + +let c = new C(); + +assert.sameValue( + c[x &&= 1], + 2 +); +assert.sameValue( + C[x &&= 1], + 2 +); + +assert.sameValue(x, 0); diff --git a/test/language/statements/class/cpn-fields-computed-property-name-from-assignment-expression-logical-or.js b/test/language/statements/class/cpn-fields-computed-property-name-from-assignment-expression-logical-or.js new file mode 100644 index 0000000000..6e52e50094 --- /dev/null +++ b/test/language/statements/class/cpn-fields-computed-property-name-from-assignment-expression-logical-or.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-logical-or.case +// - src/computed-property-names/evaluation/class-declaration-fields.template +/*--- +description: Computed property name from assignment expression logical or (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +let C = class { + [x ||= 1] = 2; + + static [x ||= 1] = 2; +}; + +let c = new C(); + +assert.sameValue( + c[x ||= 1], + 2 +); +assert.sameValue( + C[x ||= 1], + 2 +); + +assert.sameValue(x, 1); diff --git a/test/language/statements/class/cpn-fields-computed-property-name-from-async-arrow-function-expression.js b/test/language/statements/class/cpn-fields-computed-property-name-from-async-arrow-function-expression.js new file mode 100644 index 0000000000..446d56b5e6 --- /dev/null +++ b/test/language/statements/class/cpn-fields-computed-property-name-from-async-arrow-function-expression.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-async-arrow-function-expression.case +// - src/computed-property-names/evaluation/class-declaration-fields.template +/*--- +description: Computed property name from function expression (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [async () => {}] = 1; + + static [async () => {}] = 1; +}; + +let c = new C(); + +assert.sameValue( + c[async () => {}], + 1 +); +assert.sameValue( + C[async () => {}], + 1 +); diff --git a/test/language/statements/class/cpn-fields-computed-property-name-from-condition-expression-false.js b/test/language/statements/class/cpn-fields-computed-property-name-from-condition-expression-false.js new file mode 100644 index 0000000000..b9d9e4b251 --- /dev/null +++ b/test/language/statements/class/cpn-fields-computed-property-name-from-condition-expression-false.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-condition-expression-false.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] +flags: [generated] +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 { + [false ? 1 : 2] = 1; + + static [false ? 1 : 2] = 1; +}; + +let c = new C(); + +assert.sameValue( + c[false ? 1 : 2], + 1 +); +assert.sameValue( + C[false ? 1 : 2], + 1 +); diff --git a/test/language/statements/class/cpn-fields-computed-property-name-from-condition-expression-true.js b/test/language/statements/class/cpn-fields-computed-property-name-from-condition-expression-true.js new file mode 100644 index 0000000000..892202a97d --- /dev/null +++ b/test/language/statements/class/cpn-fields-computed-property-name-from-condition-expression-true.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-condition-expression-true.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] +flags: [generated] +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 { + [true ? 1 : 2] = 2; + + static [true ? 1 : 2] = 2; +}; + +let c = new C(); + +assert.sameValue( + c[true ? 1 : 2], + 2 +); +assert.sameValue( + C[true ? 1 : 2], + 2 +); diff --git a/test/language/statements/class/cpn-fields-computed-property-name-from-decimal-e-notational-literal.js b/test/language/statements/class/cpn-fields-computed-property-name-from-decimal-e-notational-literal.js new file mode 100644 index 0000000000..3f97d9930c --- /dev/null +++ b/test/language/statements/class/cpn-fields-computed-property-name-from-decimal-e-notational-literal.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-decimal-e-notational-literal.case +// - src/computed-property-names/evaluation/class-declaration-fields.template +/*--- +description: Computed property name from decimal e notational literal (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1.e1] = 2; + + static [1.e1] = 2; +}; + +let c = new C(); + +assert.sameValue( + c[1.e1], + 2 +); +assert.sameValue( + C[1.e1], + 2 +); diff --git a/test/language/statements/class/cpn-fields-computed-property-name-from-decimal-literal.js b/test/language/statements/class/cpn-fields-computed-property-name-from-decimal-literal.js new file mode 100644 index 0000000000..5ba23f4c97 --- /dev/null +++ b/test/language/statements/class/cpn-fields-computed-property-name-from-decimal-literal.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-decimal-literal.case +// - src/computed-property-names/evaluation/class-declaration-fields.template +/*--- +description: Computed property name from decimal literal (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1.1] = 2; + + static [1.1] = 2; +}; + +let c = new C(); + +assert.sameValue( + c[1.1], + 2 +); +assert.sameValue( + C[1.1], + 2 +); diff --git a/test/language/statements/class/cpn-fields-computed-property-name-from-exponetiation-expression.js b/test/language/statements/class/cpn-fields-computed-property-name-from-exponetiation-expression.js new file mode 100644 index 0000000000..1a05d5ef18 --- /dev/null +++ b/test/language/statements/class/cpn-fields-computed-property-name-from-exponetiation-expression.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-exponetiation-expression.case +// - src/computed-property-names/evaluation/class-declaration-fields.template +/*--- +description: Computed property name from exponentiation expression (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [2 ** 2] = 4; + + static [2 ** 2] = 4; +}; + +let c = new C(); + +assert.sameValue( + c[2 ** 2], + 4 +); +assert.sameValue( + C[2 ** 2], + 4 +); diff --git a/test/language/statements/class/cpn-fields-computed-property-name-from-expression-coalesce.js b/test/language/statements/class/cpn-fields-computed-property-name-from-expression-coalesce.js new file mode 100644 index 0000000000..d9ab321b0d --- /dev/null +++ b/test/language/statements/class/cpn-fields-computed-property-name-from-expression-coalesce.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-expression-coalesce.case +// - src/computed-property-names/evaluation/class-declaration-fields.template +/*--- +description: Computed property name from coalesce (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x; + + +let C = class { + [x ?? 1] = 2; + + static [x ?? 1] = 2; +}; + +let c = new C(); + +assert.sameValue( + c[x ?? 1], + 2 +); +assert.sameValue( + C[x ?? 1], + 2 +); + +assert.sameValue(x, undefined); diff --git a/test/language/statements/class/cpn-fields-computed-property-name-from-expression-logical-and.js b/test/language/statements/class/cpn-fields-computed-property-name-from-expression-logical-and.js new file mode 100644 index 0000000000..3c394fc03e --- /dev/null +++ b/test/language/statements/class/cpn-fields-computed-property-name-from-expression-logical-and.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-expression-logical-and.case +// - src/computed-property-names/evaluation/class-declaration-fields.template +/*--- +description: Computed property name from logical and (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +let C = class { + [x && 1] = 2; + + static [x && 1] = 2; +}; + +let c = new C(); + +assert.sameValue( + c[x && 1], + 2 +); +assert.sameValue( + C[x && 1], + 2 +); + +assert.sameValue(x, 0); diff --git a/test/language/statements/class/cpn-fields-computed-property-name-from-expression-logical-or.js b/test/language/statements/class/cpn-fields-computed-property-name-from-expression-logical-or.js new file mode 100644 index 0000000000..1eee730dc0 --- /dev/null +++ b/test/language/statements/class/cpn-fields-computed-property-name-from-expression-logical-or.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-expression-logical-or.case +// - src/computed-property-names/evaluation/class-declaration-fields.template +/*--- +description: Computed property name from logical or (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +let C = class { + [x || 1] = 2; + + static [x || 1] = 2; +}; + +let c = new C(); + +assert.sameValue( + c[x || 1], + 2 +); +assert.sameValue( + C[x || 1], + 2 +); + +assert.sameValue(x, 0); diff --git a/test/language/statements/class/cpn-fields-computed-property-name-from-function-declaration.js b/test/language/statements/class/cpn-fields-computed-property-name-from-function-declaration.js new file mode 100644 index 0000000000..c4a96fcfdd --- /dev/null +++ b/test/language/statements/class/cpn-fields-computed-property-name-from-function-declaration.js @@ -0,0 +1,54 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-function-declaration.case +// - src/computed-property-names/evaluation/class-declaration-fields.template +/*--- +description: Computed property name from function (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 ] +---*/ +function f() {} + + +let C = class { + [f()] = 1; + + static [f()] = 1; +}; + +let c = new C(); + +assert.sameValue( + c[f()], + 1 +); +assert.sameValue( + C[f()], + 1 +); diff --git a/test/language/statements/class/cpn-fields-computed-property-name-from-function-expression.js b/test/language/statements/class/cpn-fields-computed-property-name-from-function-expression.js new file mode 100644 index 0000000000..fafa6c6185 --- /dev/null +++ b/test/language/statements/class/cpn-fields-computed-property-name-from-function-expression.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-function-expression.case +// - src/computed-property-names/evaluation/class-declaration-fields.template +/*--- +description: Computed property name from function expression (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [function () {}] = 1; + + static [function () {}] = 1; +}; + +let c = new C(); + +assert.sameValue( + c[function () {}], + 1 +); +assert.sameValue( + C[function () {}], + 1 +); diff --git a/test/language/statements/class/cpn-fields-computed-property-name-from-generator-function-declaration.js b/test/language/statements/class/cpn-fields-computed-property-name-from-generator-function-declaration.js new file mode 100644 index 0000000000..10731d7343 --- /dev/null +++ b/test/language/statements/class/cpn-fields-computed-property-name-from-generator-function-declaration.js @@ -0,0 +1,54 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-generator-function-declaration.case +// - src/computed-property-names/evaluation/class-declaration-fields.template +/*--- +description: Computed property name from generator function (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 ] +---*/ +function * g() { return 1; } + + +let C = class { + [g()] = 1; + + static [g()] = 1; +}; + +let c = new C(); + +assert.sameValue( + c[g()], + 1 +); +assert.sameValue( + C[g()], + 1 +); diff --git a/test/language/statements/class/cpn-fields-computed-property-name-from-identifier.js b/test/language/statements/class/cpn-fields-computed-property-name-from-identifier.js new file mode 100644 index 0000000000..223ea5c274 --- /dev/null +++ b/test/language/statements/class/cpn-fields-computed-property-name-from-identifier.js @@ -0,0 +1,55 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-identifier.case +// - src/computed-property-names/evaluation/class-declaration-fields.template +/*--- +description: Computed property name from string literal (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 1; + + + +let C = class { + [x] = '2'; + + static [x] = '2'; +}; + +let c = new C(); + +assert.sameValue( + c[x], + '2' +); +assert.sameValue( + C[x], + '2' +); diff --git a/test/language/statements/class/cpn-fields-computed-property-name-from-integer-e-notational-literal.js b/test/language/statements/class/cpn-fields-computed-property-name-from-integer-e-notational-literal.js new file mode 100644 index 0000000000..c8a4f55d7d --- /dev/null +++ b/test/language/statements/class/cpn-fields-computed-property-name-from-integer-e-notational-literal.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-integer-e-notational-literal.case +// - src/computed-property-names/evaluation/class-declaration-fields.template +/*--- +description: Computed property name from numeric literal (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1] = 2; + + static [1] = 2; +}; + +let c = new C(); + +assert.sameValue( + c[1], + 2 +); +assert.sameValue( + C[1], + 2 +); diff --git a/test/language/statements/class/cpn-fields-computed-property-name-from-integer-separators.js b/test/language/statements/class/cpn-fields-computed-property-name-from-integer-separators.js new file mode 100644 index 0000000000..205d83549b --- /dev/null +++ b/test/language/statements/class/cpn-fields-computed-property-name-from-integer-separators.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-integer-separators.case +// - src/computed-property-names/evaluation/class-declaration-fields.template +/*--- +description: Computed property name from integer with separators (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1_2_3_4_5_6_7_8] = 1_2_3_4_5_6_7_8; + + static [1_2_3_4_5_6_7_8] = 1_2_3_4_5_6_7_8; +}; + +let c = new C(); + +assert.sameValue( + c[1_2_3_4_5_6_7_8], + 1_2_3_4_5_6_7_8 +); +assert.sameValue( + C[1_2_3_4_5_6_7_8], + 1_2_3_4_5_6_7_8 +); diff --git a/test/language/statements/class/cpn-fields-computed-property-name-from-math.js b/test/language/statements/class/cpn-fields-computed-property-name-from-math.js new file mode 100644 index 0000000000..357fb4948e --- /dev/null +++ b/test/language/statements/class/cpn-fields-computed-property-name-from-math.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-math.case +// - src/computed-property-names/evaluation/class-declaration-fields.template +/*--- +description: Computed property name from math (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1 + 2 - 3 * 4 / 5 ** 6] = 2.999232; + + static [1 + 2 - 3 * 4 / 5 ** 6] = 2.999232; +}; + +let c = new C(); + +assert.sameValue( + c[1 + 2 - 3 * 4 / 5 ** 6], + 2.999232 +); +assert.sameValue( + C[1 + 2 - 3 * 4 / 5 ** 6], + 2.999232 +); diff --git a/test/language/statements/class/cpn-fields-computed-property-name-from-multiplicative-expression-div.js b/test/language/statements/class/cpn-fields-computed-property-name-from-multiplicative-expression-div.js new file mode 100644 index 0000000000..465b2cf3c1 --- /dev/null +++ b/test/language/statements/class/cpn-fields-computed-property-name-from-multiplicative-expression-div.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-multiplicative-expression-div.case +// - src/computed-property-names/evaluation/class-declaration-fields.template +/*--- +description: Computed property name from multiplicative expression "divide" (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1 / 1] = 1; + + static [1 / 1] = 1; +}; + +let c = new C(); + +assert.sameValue( + c[1 / 1], + 1 +); +assert.sameValue( + C[1 / 1], + 1 +); diff --git a/test/language/statements/class/cpn-fields-computed-property-name-from-multiplicative-expression-mult.js b/test/language/statements/class/cpn-fields-computed-property-name-from-multiplicative-expression-mult.js new file mode 100644 index 0000000000..214ba329e0 --- /dev/null +++ b/test/language/statements/class/cpn-fields-computed-property-name-from-multiplicative-expression-mult.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-multiplicative-expression-mult.case +// - src/computed-property-names/evaluation/class-declaration-fields.template +/*--- +description: Computed property name from multiplicative expression "multiply" (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1 * 1] = 1; + + static [1 * 1] = 1; +}; + +let c = new C(); + +assert.sameValue( + c[1 * 1], + 1 +); +assert.sameValue( + C[1 * 1], + 1 +); diff --git a/test/language/statements/class/cpn-fields-computed-property-name-from-numeric-literal.js b/test/language/statements/class/cpn-fields-computed-property-name-from-numeric-literal.js new file mode 100644 index 0000000000..19356afcfb --- /dev/null +++ b/test/language/statements/class/cpn-fields-computed-property-name-from-numeric-literal.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-numeric-literal.case +// - src/computed-property-names/evaluation/class-declaration-fields.template +/*--- +description: Computed property name from numeric literal (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1] = 2; + + static [1] = 2; +}; + +let c = new C(); + +assert.sameValue( + c[1], + 2 +); +assert.sameValue( + C[1], + 2 +); diff --git a/test/language/statements/class/cpn-fields-computed-property-name-from-string-literal.js b/test/language/statements/class/cpn-fields-computed-property-name-from-string-literal.js new file mode 100644 index 0000000000..d40596a449 --- /dev/null +++ b/test/language/statements/class/cpn-fields-computed-property-name-from-string-literal.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-string-literal.case +// - src/computed-property-names/evaluation/class-declaration-fields.template +/*--- +description: Computed property name from string literal (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + ['1'] = '2'; + + static ['1'] = '2'; +}; + +let c = new C(); + +assert.sameValue( + c['1'], + '2' +); +assert.sameValue( + C['1'], + '2' +); diff --git a/test/language/statements/class/cpn-fields-computed-property-name-from-yield-expression.js b/test/language/statements/class/cpn-fields-computed-property-name-from-yield-expression.js new file mode 100644 index 0000000000..e6cf0bf6ed --- /dev/null +++ b/test/language/statements/class/cpn-fields-computed-property-name-from-yield-expression.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-yield-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] +flags: [generated] +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 { + [true ? 1 : 2] = 2; + + static [true ? 1 : 2] = 2; +}; + +let c = new C(); + +assert.sameValue( + c[true ? 1 : 2], + 2 +); +assert.sameValue( + C[true ? 1 : 2], + 2 +); diff --git a/test/language/statements/class/cpn-fields-methods-computed-property-name-from-additive-expression-add.js b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-additive-expression-add.js new file mode 100644 index 0000000000..1ff660b979 --- /dev/null +++ b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-additive-expression-add.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-additive-expression-add.case +// - src/computed-property-names/evaluation/class-declaration-fields-methods.template +/*--- +description: Computed property name from additive expression "add" (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1 + 1] = () => { + return 2; + }; + + static [1 + 1] = () => { + return 2; + }; +}; + +let c = new C(); + +assert.sameValue( + c[1 + 1](), + 2 +); +assert.sameValue( + C[1 + 1](), + 2 +); diff --git a/test/language/statements/class/cpn-fields-methods-computed-property-name-from-additive-expression-subtract.js b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-additive-expression-subtract.js new file mode 100644 index 0000000000..7cbeadab10 --- /dev/null +++ b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-additive-expression-subtract.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-additive-expression-subtract.case +// - src/computed-property-names/evaluation/class-declaration-fields-methods.template +/*--- +description: Computed property name from additive expression "subtract" (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1 - 1] = () => { + return 0; + }; + + static [1 - 1] = () => { + return 0; + }; +}; + +let c = new C(); + +assert.sameValue( + c[1 - 1](), + 0 +); +assert.sameValue( + C[1 - 1](), + 0 +); diff --git a/test/language/statements/class/cpn-fields-methods-computed-property-name-from-arrow-function-expression.js b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-arrow-function-expression.js new file mode 100644 index 0000000000..f7f0742450 --- /dev/null +++ b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-arrow-function-expression.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-arrow-function-expression.case +// - src/computed-property-names/evaluation/class-declaration-fields-methods.template +/*--- +description: Computed property name from arrow function (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [() => { }] = () => { + return 1; + }; + + static [() => { }] = () => { + return 1; + }; +}; + +let c = new C(); + +assert.sameValue( + c[() => { }](), + 1 +); +assert.sameValue( + C[() => { }](), + 1 +); diff --git a/test/language/statements/class/cpn-fields-methods-computed-property-name-from-assignment-expression-assignment.js b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-assignment-expression-assignment.js new file mode 100644 index 0000000000..09ce1d8e77 --- /dev/null +++ b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-assignment-expression-assignment.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-assignment.case +// - src/computed-property-names/evaluation/class-declaration-fields-methods.template +/*--- +description: Computed property name from assignment expression (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +let C = class { + [x = 1] = () => { + return 2; + }; + + static [x = 1] = () => { + return 2; + }; +}; + +let c = new C(); + +assert.sameValue( + c[x = 1](), + 2 +); +assert.sameValue( + C[x = 1](), + 2 +); + +assert.sameValue(x, 1); diff --git a/test/language/statements/class/cpn-fields-methods-computed-property-name-from-assignment-expression-bitwise-or.js b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-assignment-expression-bitwise-or.js new file mode 100644 index 0000000000..3aea034046 --- /dev/null +++ b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-assignment-expression-bitwise-or.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-bitwise-or.case +// - src/computed-property-names/evaluation/class-declaration-fields-methods.template +/*--- +description: Computed property name from assignment expression bitwise or (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +let C = class { + [x |= 1] = () => { + return 2; + }; + + static [x |= 1] = () => { + return 2; + }; +}; + +let c = new C(); + +assert.sameValue( + c[x |= 1](), + 2 +); +assert.sameValue( + C[x |= 1](), + 2 +); + +assert.sameValue(x, 1); diff --git a/test/language/statements/class/cpn-fields-methods-computed-property-name-from-assignment-expression-coalesce.js b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-assignment-expression-coalesce.js new file mode 100644 index 0000000000..2215a3e30c --- /dev/null +++ b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-assignment-expression-coalesce.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-coalesce.case +// - src/computed-property-names/evaluation/class-declaration-fields-methods.template +/*--- +description: Computed property name from assignment expression coalesce (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = null; + + +let C = class { + [x ??= 1] = () => { + return 2; + }; + + static [x ??= 1] = () => { + return 2; + }; +}; + +let c = new C(); + +assert.sameValue( + c[x ??= 1](), + 2 +); +assert.sameValue( + C[x ??= 1](), + 2 +); + +assert.sameValue(x, 1); diff --git a/test/language/statements/class/cpn-fields-methods-computed-property-name-from-assignment-expression-logical-and.js b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-assignment-expression-logical-and.js new file mode 100644 index 0000000000..8c0bfe554c --- /dev/null +++ b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-assignment-expression-logical-and.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-logical-and.case +// - src/computed-property-names/evaluation/class-declaration-fields-methods.template +/*--- +description: Computed property name from assignment expression logical and (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +let C = class { + [x &&= 1] = () => { + return 2; + }; + + static [x &&= 1] = () => { + return 2; + }; +}; + +let c = new C(); + +assert.sameValue( + c[x &&= 1](), + 2 +); +assert.sameValue( + C[x &&= 1](), + 2 +); + +assert.sameValue(x, 0); diff --git a/test/language/statements/class/cpn-fields-methods-computed-property-name-from-assignment-expression-logical-or.js b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-assignment-expression-logical-or.js new file mode 100644 index 0000000000..bc39a8f834 --- /dev/null +++ b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-assignment-expression-logical-or.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-assignment-expression-logical-or.case +// - src/computed-property-names/evaluation/class-declaration-fields-methods.template +/*--- +description: Computed property name from assignment expression logical or (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +let C = class { + [x ||= 1] = () => { + return 2; + }; + + static [x ||= 1] = () => { + return 2; + }; +}; + +let c = new C(); + +assert.sameValue( + c[x ||= 1](), + 2 +); +assert.sameValue( + C[x ||= 1](), + 2 +); + +assert.sameValue(x, 1); diff --git a/test/language/statements/class/cpn-fields-methods-computed-property-name-from-async-arrow-function-expression.js b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-async-arrow-function-expression.js new file mode 100644 index 0000000000..aefe5652f7 --- /dev/null +++ b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-async-arrow-function-expression.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-async-arrow-function-expression.case +// - src/computed-property-names/evaluation/class-declaration-fields-methods.template +/*--- +description: Computed property name from function expression (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [async () => {}] = () => { + return 1; + }; + + static [async () => {}] = () => { + return 1; + }; +}; + +let c = new C(); + +assert.sameValue( + c[async () => {}](), + 1 +); +assert.sameValue( + C[async () => {}](), + 1 +); diff --git a/test/language/statements/class/cpn-fields-methods-computed-property-name-from-condition-expression-false.js b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-condition-expression-false.js new file mode 100644 index 0000000000..46ae9c3909 --- /dev/null +++ b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-condition-expression-false.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-condition-expression-false.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] +flags: [generated] +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 { + [false ? 1 : 2] = () => { + return 1; + }; + + static [false ? 1 : 2] = () => { + return 1; + }; +}; + +let c = new C(); + +assert.sameValue( + c[false ? 1 : 2](), + 1 +); +assert.sameValue( + C[false ? 1 : 2](), + 1 +); diff --git a/test/language/statements/class/cpn-fields-methods-computed-property-name-from-condition-expression-true.js b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-condition-expression-true.js new file mode 100644 index 0000000000..cd9d9ddc57 --- /dev/null +++ b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-condition-expression-true.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-condition-expression-true.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] +flags: [generated] +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 { + [true ? 1 : 2] = () => { + return 2; + }; + + static [true ? 1 : 2] = () => { + return 2; + }; +}; + +let c = new C(); + +assert.sameValue( + c[true ? 1 : 2](), + 2 +); +assert.sameValue( + C[true ? 1 : 2](), + 2 +); diff --git a/test/language/statements/class/cpn-fields-methods-computed-property-name-from-decimal-e-notational-literal.js b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-decimal-e-notational-literal.js new file mode 100644 index 0000000000..db83da5a5f --- /dev/null +++ b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-decimal-e-notational-literal.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-decimal-e-notational-literal.case +// - src/computed-property-names/evaluation/class-declaration-fields-methods.template +/*--- +description: Computed property name from decimal e notational literal (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1.e1] = () => { + return 2; + }; + + static [1.e1] = () => { + return 2; + }; +}; + +let c = new C(); + +assert.sameValue( + c[1.e1](), + 2 +); +assert.sameValue( + C[1.e1](), + 2 +); diff --git a/test/language/statements/class/cpn-fields-methods-computed-property-name-from-decimal-literal.js b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-decimal-literal.js new file mode 100644 index 0000000000..2c1742d90c --- /dev/null +++ b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-decimal-literal.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-decimal-literal.case +// - src/computed-property-names/evaluation/class-declaration-fields-methods.template +/*--- +description: Computed property name from decimal literal (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1.1] = () => { + return 2; + }; + + static [1.1] = () => { + return 2; + }; +}; + +let c = new C(); + +assert.sameValue( + c[1.1](), + 2 +); +assert.sameValue( + C[1.1](), + 2 +); diff --git a/test/language/statements/class/cpn-fields-methods-computed-property-name-from-exponetiation-expression.js b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-exponetiation-expression.js new file mode 100644 index 0000000000..f920c4ed2b --- /dev/null +++ b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-exponetiation-expression.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-exponetiation-expression.case +// - src/computed-property-names/evaluation/class-declaration-fields-methods.template +/*--- +description: Computed property name from exponentiation expression (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [2 ** 2] = () => { + return 4; + }; + + static [2 ** 2] = () => { + return 4; + }; +}; + +let c = new C(); + +assert.sameValue( + c[2 ** 2](), + 4 +); +assert.sameValue( + C[2 ** 2](), + 4 +); diff --git a/test/language/statements/class/cpn-fields-methods-computed-property-name-from-expression-coalesce.js b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-expression-coalesce.js new file mode 100644 index 0000000000..ea8146e5da --- /dev/null +++ b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-expression-coalesce.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-expression-coalesce.case +// - src/computed-property-names/evaluation/class-declaration-fields-methods.template +/*--- +description: Computed property name from coalesce (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x; + + +let C = class { + [x ?? 1] = () => { + return 2; + }; + + static [x ?? 1] = () => { + return 2; + }; +}; + +let c = new C(); + +assert.sameValue( + c[x ?? 1](), + 2 +); +assert.sameValue( + C[x ?? 1](), + 2 +); + +assert.sameValue(x, undefined); diff --git a/test/language/statements/class/cpn-fields-methods-computed-property-name-from-expression-logical-and.js b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-expression-logical-and.js new file mode 100644 index 0000000000..57212a688c --- /dev/null +++ b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-expression-logical-and.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-expression-logical-and.case +// - src/computed-property-names/evaluation/class-declaration-fields-methods.template +/*--- +description: Computed property name from logical and (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +let C = class { + [x && 1] = () => { + return 2; + }; + + static [x && 1] = () => { + return 2; + }; +}; + +let c = new C(); + +assert.sameValue( + c[x && 1](), + 2 +); +assert.sameValue( + C[x && 1](), + 2 +); + +assert.sameValue(x, 0); diff --git a/test/language/statements/class/cpn-fields-methods-computed-property-name-from-expression-logical-or.js b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-expression-logical-or.js new file mode 100644 index 0000000000..1d9f30272c --- /dev/null +++ b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-expression-logical-or.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-expression-logical-or.case +// - src/computed-property-names/evaluation/class-declaration-fields-methods.template +/*--- +description: Computed property name from logical or (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 0; + + +let C = class { + [x || 1] = () => { + return 2; + }; + + static [x || 1] = () => { + return 2; + }; +}; + +let c = new C(); + +assert.sameValue( + c[x || 1](), + 2 +); +assert.sameValue( + C[x || 1](), + 2 +); + +assert.sameValue(x, 0); diff --git a/test/language/statements/class/cpn-fields-methods-computed-property-name-from-function-declaration.js b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-function-declaration.js new file mode 100644 index 0000000000..c9d6256cf8 --- /dev/null +++ b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-function-declaration.js @@ -0,0 +1,58 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-function-declaration.case +// - src/computed-property-names/evaluation/class-declaration-fields-methods.template +/*--- +description: Computed property name from function (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 ] +---*/ +function f() {} + + +let C = class { + [f()] = () => { + return 1; + }; + + static [f()] = () => { + return 1; + }; +}; + +let c = new C(); + +assert.sameValue( + c[f()](), + 1 +); +assert.sameValue( + C[f()](), + 1 +); diff --git a/test/language/statements/class/cpn-fields-methods-computed-property-name-from-function-expression.js b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-function-expression.js new file mode 100644 index 0000000000..1160c22266 --- /dev/null +++ b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-function-expression.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-function-expression.case +// - src/computed-property-names/evaluation/class-declaration-fields-methods.template +/*--- +description: Computed property name from function expression (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [function () {}] = () => { + return 1; + }; + + static [function () {}] = () => { + return 1; + }; +}; + +let c = new C(); + +assert.sameValue( + c[function () {}](), + 1 +); +assert.sameValue( + C[function () {}](), + 1 +); diff --git a/test/language/statements/class/cpn-fields-methods-computed-property-name-from-generator-function-declaration.js b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-generator-function-declaration.js new file mode 100644 index 0000000000..bc28389cfa --- /dev/null +++ b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-generator-function-declaration.js @@ -0,0 +1,58 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-generator-function-declaration.case +// - src/computed-property-names/evaluation/class-declaration-fields-methods.template +/*--- +description: Computed property name from generator function (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 ] +---*/ +function * g() { return 1; } + + +let C = class { + [g()] = () => { + return 1; + }; + + static [g()] = () => { + return 1; + }; +}; + +let c = new C(); + +assert.sameValue( + c[g()](), + 1 +); +assert.sameValue( + C[g()](), + 1 +); diff --git a/test/language/statements/class/cpn-fields-methods-computed-property-name-from-identifier.js b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-identifier.js new file mode 100644 index 0000000000..c6dbbcbcad --- /dev/null +++ b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-identifier.js @@ -0,0 +1,59 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-identifier.case +// - src/computed-property-names/evaluation/class-declaration-fields-methods.template +/*--- +description: Computed property name from string literal (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 x = 1; + + + +let C = class { + [x] = () => { + return '2'; + }; + + static [x] = () => { + return '2'; + }; +}; + +let c = new C(); + +assert.sameValue( + c[x](), + '2' +); +assert.sameValue( + C[x](), + '2' +); diff --git a/test/language/statements/class/cpn-fields-methods-computed-property-name-from-integer-e-notational-literal.js b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-integer-e-notational-literal.js new file mode 100644 index 0000000000..7bd091ef7d --- /dev/null +++ b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-integer-e-notational-literal.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-integer-e-notational-literal.case +// - src/computed-property-names/evaluation/class-declaration-fields-methods.template +/*--- +description: Computed property name from numeric literal (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1] = () => { + return 2; + }; + + static [1] = () => { + return 2; + }; +}; + +let c = new C(); + +assert.sameValue( + c[1](), + 2 +); +assert.sameValue( + C[1](), + 2 +); diff --git a/test/language/statements/class/cpn-fields-methods-computed-property-name-from-integer-separators.js b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-integer-separators.js new file mode 100644 index 0000000000..ce199bece0 --- /dev/null +++ b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-integer-separators.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-integer-separators.case +// - src/computed-property-names/evaluation/class-declaration-fields-methods.template +/*--- +description: Computed property name from integer with separators (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1_2_3_4_5_6_7_8] = () => { + return 1_2_3_4_5_6_7_8; + }; + + static [1_2_3_4_5_6_7_8] = () => { + return 1_2_3_4_5_6_7_8; + }; +}; + +let c = new C(); + +assert.sameValue( + c[1_2_3_4_5_6_7_8](), + 1_2_3_4_5_6_7_8 +); +assert.sameValue( + C[1_2_3_4_5_6_7_8](), + 1_2_3_4_5_6_7_8 +); diff --git a/test/language/statements/class/cpn-fields-methods-computed-property-name-from-math.js b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-math.js new file mode 100644 index 0000000000..b0b0ff80de --- /dev/null +++ b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-math.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-math.case +// - src/computed-property-names/evaluation/class-declaration-fields-methods.template +/*--- +description: Computed property name from math (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1 + 2 - 3 * 4 / 5 ** 6] = () => { + return 2.999232; + }; + + static [1 + 2 - 3 * 4 / 5 ** 6] = () => { + return 2.999232; + }; +}; + +let c = new C(); + +assert.sameValue( + c[1 + 2 - 3 * 4 / 5 ** 6](), + 2.999232 +); +assert.sameValue( + C[1 + 2 - 3 * 4 / 5 ** 6](), + 2.999232 +); diff --git a/test/language/statements/class/cpn-fields-methods-computed-property-name-from-multiplicative-expression-div.js b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-multiplicative-expression-div.js new file mode 100644 index 0000000000..06be10b0bd --- /dev/null +++ b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-multiplicative-expression-div.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-multiplicative-expression-div.case +// - src/computed-property-names/evaluation/class-declaration-fields-methods.template +/*--- +description: Computed property name from multiplicative expression "divide" (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1 / 1] = () => { + return 1; + }; + + static [1 / 1] = () => { + return 1; + }; +}; + +let c = new C(); + +assert.sameValue( + c[1 / 1](), + 1 +); +assert.sameValue( + C[1 / 1](), + 1 +); diff --git a/test/language/statements/class/cpn-fields-methods-computed-property-name-from-multiplicative-expression-mult.js b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-multiplicative-expression-mult.js new file mode 100644 index 0000000000..f5b100e4e6 --- /dev/null +++ b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-multiplicative-expression-mult.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-multiplicative-expression-mult.case +// - src/computed-property-names/evaluation/class-declaration-fields-methods.template +/*--- +description: Computed property name from multiplicative expression "multiply" (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1 * 1] = () => { + return 1; + }; + + static [1 * 1] = () => { + return 1; + }; +}; + +let c = new C(); + +assert.sameValue( + c[1 * 1](), + 1 +); +assert.sameValue( + C[1 * 1](), + 1 +); diff --git a/test/language/statements/class/cpn-fields-methods-computed-property-name-from-numeric-literal.js b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-numeric-literal.js new file mode 100644 index 0000000000..e61fc143a8 --- /dev/null +++ b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-numeric-literal.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-numeric-literal.case +// - src/computed-property-names/evaluation/class-declaration-fields-methods.template +/*--- +description: Computed property name from numeric literal (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + [1] = () => { + return 2; + }; + + static [1] = () => { + return 2; + }; +}; + +let c = new C(); + +assert.sameValue( + c[1](), + 2 +); +assert.sameValue( + C[1](), + 2 +); diff --git a/test/language/statements/class/cpn-fields-methods-computed-property-name-from-string-literal.js b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-string-literal.js new file mode 100644 index 0000000000..2e61887777 --- /dev/null +++ b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-string-literal.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-string-literal.case +// - src/computed-property-names/evaluation/class-declaration-fields-methods.template +/*--- +description: Computed property name from string literal (ComputedPropertyName in ClassExpression) +esid: prod-ComputedPropertyName +features: [computed-property-names] +flags: [generated] +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 { + ['1'] = () => { + return '2'; + }; + + static ['1'] = () => { + return '2'; + }; +}; + +let c = new C(); + +assert.sameValue( + c['1'](), + '2' +); +assert.sameValue( + C['1'](), + '2' +); diff --git a/test/language/statements/class/cpn-fields-methods-computed-property-name-from-yield-expression.js b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-yield-expression.js new file mode 100644 index 0000000000..1fbe11edd5 --- /dev/null +++ b/test/language/statements/class/cpn-fields-methods-computed-property-name-from-yield-expression.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/computed-property-names/computed-property-name-from-yield-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] +flags: [generated] +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 { + [true ? 1 : 2] = () => { + return 2; + }; + + static [true ? 1 : 2] = () => { + return 2; + }; +}; + +let c = new C(); + +assert.sameValue( + c[true ? 1 : 2](), + 2 +); +assert.sameValue( + C[true ? 1 : 2](), + 2 +);