From aee9dc163e494f56684f3f2ba7381b7be1fa659e Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Mon, 6 Aug 2018 13:59:20 -0400 Subject: [PATCH] Generate tests --- ...tename-identifier-semantics-stringvalue.js | 105 ++++++++++++ ...ine-gen-rs-field-identifier-initializer.js | 83 +++++++++ ...after-same-line-gen-rs-field-identifier.js | 90 ++++++++++ ...-line-gen-rs-privatename-identifier-alt.js | 105 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 99 +++++++++++ ...n-rs-privatename-identifier-initializer.js | 99 +++++++++++ ...same-line-gen-rs-privatename-identifier.js | 105 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 124 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 118 +++++++++++++ ...en-rs-static-privatename-identifier-alt.js | 106 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 100 +++++++++++ ...atic-privatename-identifier-initializer.js | 100 +++++++++++ ...ne-gen-rs-static-privatename-identifier.js | 106 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 105 ++++++++++++ ...-method-rs-field-identifier-initializer.js | 83 +++++++++ ...er-same-line-method-rs-field-identifier.js | 90 ++++++++++ ...ne-method-rs-privatename-identifier-alt.js | 105 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 99 +++++++++++ ...d-rs-privatename-identifier-initializer.js | 99 +++++++++++ ...e-line-method-rs-privatename-identifier.js | 105 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 124 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 118 +++++++++++++ ...od-rs-static-privatename-identifier-alt.js | 106 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 100 +++++++++++ ...atic-privatename-identifier-initializer.js | 100 +++++++++++ ...method-rs-static-privatename-identifier.js | 106 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 109 ++++++++++++ ...ync-gen-rs-field-identifier-initializer.js | 87 ++++++++++ ...ne-static-async-gen-rs-field-identifier.js | 94 ++++++++++ ...async-gen-rs-privatename-identifier-alt.js | 109 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 103 +++++++++++ ...n-rs-privatename-identifier-initializer.js | 103 +++++++++++ ...tic-async-gen-rs-privatename-identifier.js | 109 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 128 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 122 +++++++++++++ ...en-rs-static-privatename-identifier-alt.js | 110 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 104 ++++++++++++ ...atic-privatename-identifier-initializer.js | 104 ++++++++++++ ...nc-gen-rs-static-privatename-identifier.js | 110 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 108 ++++++++++++ ...-method-rs-field-identifier-initializer.js | 86 ++++++++++ ...static-async-method-rs-field-identifier.js | 93 ++++++++++ ...nc-method-rs-privatename-identifier-alt.js | 108 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 102 +++++++++++ ...d-rs-privatename-identifier-initializer.js | 102 +++++++++++ ...-async-method-rs-privatename-identifier.js | 108 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 127 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 121 +++++++++++++ ...od-rs-static-privatename-identifier-alt.js | 109 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 103 +++++++++++ ...atic-privatename-identifier-initializer.js | 103 +++++++++++ ...method-rs-static-privatename-identifier.js | 109 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 105 ++++++++++++ ...tic-gen-rs-field-identifier-initializer.js | 83 +++++++++ ...ame-line-static-gen-rs-field-identifier.js | 90 ++++++++++ ...tatic-gen-rs-privatename-identifier-alt.js | 105 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 99 +++++++++++ ...n-rs-privatename-identifier-initializer.js | 99 +++++++++++ ...ne-static-gen-rs-privatename-identifier.js | 105 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 124 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 118 +++++++++++++ ...en-rs-static-privatename-identifier-alt.js | 106 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 100 +++++++++++ ...atic-privatename-identifier-initializer.js | 100 +++++++++++ ...ic-gen-rs-static-privatename-identifier.js | 106 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 105 ++++++++++++ ...-method-rs-field-identifier-initializer.js | 83 +++++++++ ...-line-static-method-rs-field-identifier.js | 90 ++++++++++ ...ic-method-rs-privatename-identifier-alt.js | 105 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 99 +++++++++++ ...d-rs-privatename-identifier-initializer.js | 99 +++++++++++ ...static-method-rs-privatename-identifier.js | 105 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 124 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 118 +++++++++++++ ...od-rs-static-privatename-identifier-alt.js | 106 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 100 +++++++++++ ...atic-privatename-identifier-initializer.js | 100 +++++++++++ ...method-rs-static-privatename-identifier.js | 106 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 141 +++++++++++++++ ...nitions-rs-field-identifier-initializer.js | 119 +++++++++++++ ...ultiple-definitions-rs-field-identifier.js | 126 ++++++++++++++ ...finitions-rs-privatename-identifier-alt.js | 141 +++++++++++++++ ...-privatename-identifier-initializer-alt.js | 135 +++++++++++++++ ...s-rs-privatename-identifier-initializer.js | 135 +++++++++++++++ ...e-definitions-rs-privatename-identifier.js | 141 +++++++++++++++ ...tatic-method-privatename-identifier-alt.js | 160 ++++++++++++++++++ ...rs-static-method-privatename-identifier.js | 154 +++++++++++++++++ ...ns-rs-static-privatename-identifier-alt.js | 142 ++++++++++++++++ ...-privatename-identifier-initializer-alt.js | 136 +++++++++++++++ ...atic-privatename-identifier-initializer.js | 136 +++++++++++++++ ...itions-rs-static-privatename-identifier.js | 142 ++++++++++++++++ ...tename-identifier-semantics-stringvalue.js | 119 +++++++++++++ ...nitions-rs-field-identifier-initializer.js | 97 +++++++++++ ...stacked-definitions-rs-field-identifier.js | 104 ++++++++++++ ...finitions-rs-privatename-identifier-alt.js | 119 +++++++++++++ ...-privatename-identifier-initializer-alt.js | 113 +++++++++++++ ...s-rs-privatename-identifier-initializer.js | 113 +++++++++++++ ...d-definitions-rs-privatename-identifier.js | 119 +++++++++++++ ...tatic-method-privatename-identifier-alt.js | 138 +++++++++++++++ ...rs-static-method-privatename-identifier.js | 132 +++++++++++++++ ...ns-rs-static-privatename-identifier-alt.js | 120 +++++++++++++ ...-privatename-identifier-initializer-alt.js | 114 +++++++++++++ ...atic-privatename-identifier-initializer.js | 114 +++++++++++++ ...itions-rs-static-privatename-identifier.js | 120 +++++++++++++ ...tename-identifier-semantics-stringvalue.js | 106 ++++++++++++ ...-method-rs-field-identifier-initializer.js | 84 +++++++++ ...w-no-sc-line-method-rs-field-identifier.js | 91 ++++++++++ ...ne-method-rs-privatename-identifier-alt.js | 106 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 100 +++++++++++ ...d-rs-privatename-identifier-initializer.js | 100 +++++++++++ ...c-line-method-rs-privatename-identifier.js | 106 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 125 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 119 +++++++++++++ ...od-rs-static-privatename-identifier-alt.js | 107 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 101 +++++++++++ ...atic-privatename-identifier-initializer.js | 101 +++++++++++ ...method-rs-static-privatename-identifier.js | 107 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 106 ++++++++++++ ...ine-gen-rs-field-identifier-initializer.js | 84 +++++++++ ...lds-new-sc-line-gen-rs-field-identifier.js | 91 ++++++++++ ...-line-gen-rs-privatename-identifier-alt.js | 106 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 100 +++++++++++ ...n-rs-privatename-identifier-initializer.js | 100 +++++++++++ ...w-sc-line-gen-rs-privatename-identifier.js | 106 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 125 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 119 +++++++++++++ ...en-rs-static-privatename-identifier-alt.js | 107 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 101 +++++++++++ ...atic-privatename-identifier-initializer.js | 101 +++++++++++ ...ne-gen-rs-static-privatename-identifier.js | 107 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 106 ++++++++++++ ...-method-rs-field-identifier-initializer.js | 84 +++++++++ ...-new-sc-line-method-rs-field-identifier.js | 91 ++++++++++ ...ne-method-rs-privatename-identifier-alt.js | 106 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 100 +++++++++++ ...d-rs-privatename-identifier-initializer.js | 100 +++++++++++ ...c-line-method-rs-privatename-identifier.js | 106 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 125 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 119 +++++++++++++ ...od-rs-static-privatename-identifier-alt.js | 107 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 101 +++++++++++ ...atic-privatename-identifier-initializer.js | 101 +++++++++++ ...method-rs-static-privatename-identifier.js | 107 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 94 ++++++++++ ...nitions-rs-field-identifier-initializer.js | 72 ++++++++ ...regular-definitions-rs-field-identifier.js | 79 +++++++++ ...finitions-rs-privatename-identifier-alt.js | 94 ++++++++++ ...-privatename-identifier-initializer-alt.js | 88 ++++++++++ ...s-rs-privatename-identifier-initializer.js | 88 ++++++++++ ...r-definitions-rs-privatename-identifier.js | 94 ++++++++++ ...tatic-method-privatename-identifier-alt.js | 113 +++++++++++++ ...rs-static-method-privatename-identifier.js | 107 ++++++++++++ ...ns-rs-static-privatename-identifier-alt.js | 95 +++++++++++ ...-privatename-identifier-initializer-alt.js | 89 ++++++++++ ...atic-privatename-identifier-initializer.js | 89 ++++++++++ ...itions-rs-static-privatename-identifier.js | 95 +++++++++++ ...tename-identifier-semantics-stringvalue.js | 109 ++++++++++++ ...ync-gen-rs-field-identifier-initializer.js | 87 ++++++++++ ...same-line-async-gen-rs-field-identifier.js | 94 ++++++++++ ...async-gen-rs-privatename-identifier-alt.js | 109 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 103 +++++++++++ ...n-rs-privatename-identifier-initializer.js | 103 +++++++++++ ...ine-async-gen-rs-privatename-identifier.js | 109 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 128 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 122 +++++++++++++ ...en-rs-static-privatename-identifier-alt.js | 110 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 104 ++++++++++++ ...atic-privatename-identifier-initializer.js | 104 ++++++++++++ ...nc-gen-rs-static-privatename-identifier.js | 110 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 108 ++++++++++++ ...-method-rs-field-identifier-initializer.js | 86 ++++++++++ ...e-line-async-method-rs-field-identifier.js | 93 ++++++++++ ...nc-method-rs-privatename-identifier-alt.js | 108 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 102 +++++++++++ ...d-rs-privatename-identifier-initializer.js | 102 +++++++++++ ...-async-method-rs-privatename-identifier.js | 108 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 127 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 121 +++++++++++++ ...od-rs-static-privatename-identifier-alt.js | 109 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 103 +++++++++++ ...atic-privatename-identifier-initializer.js | 103 +++++++++++ ...method-rs-static-privatename-identifier.js | 109 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 105 ++++++++++++ ...ine-gen-rs-field-identifier-initializer.js | 83 +++++++++ ...ields-same-line-gen-rs-field-identifier.js | 90 ++++++++++ ...-line-gen-rs-privatename-identifier-alt.js | 105 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 99 +++++++++++ ...n-rs-privatename-identifier-initializer.js | 99 +++++++++++ ...same-line-gen-rs-privatename-identifier.js | 105 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 124 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 118 +++++++++++++ ...en-rs-static-privatename-identifier-alt.js | 106 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 100 +++++++++++ ...atic-privatename-identifier-initializer.js | 100 +++++++++++ ...ne-gen-rs-static-privatename-identifier.js | 106 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 105 ++++++++++++ ...-method-rs-field-identifier-initializer.js | 83 +++++++++ ...ds-same-line-method-rs-field-identifier.js | 90 ++++++++++ ...ne-method-rs-privatename-identifier-alt.js | 105 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 99 +++++++++++ ...d-rs-privatename-identifier-initializer.js | 99 +++++++++++ ...e-line-method-rs-privatename-identifier.js | 105 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 124 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 118 +++++++++++++ ...od-rs-static-privatename-identifier-alt.js | 106 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 100 +++++++++++ ...atic-privatename-identifier-initializer.js | 100 +++++++++++ ...method-rs-static-privatename-identifier.js | 106 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 96 +++++++++++ ...d-in-sc-rs-field-identifier-initializer.js | 74 ++++++++ ...ields-wrapped-in-sc-rs-field-identifier.js | 81 +++++++++ ...ped-in-sc-rs-privatename-identifier-alt.js | 96 +++++++++++ ...-privatename-identifier-initializer-alt.js | 90 ++++++++++ ...c-rs-privatename-identifier-initializer.js | 90 ++++++++++ ...wrapped-in-sc-rs-privatename-identifier.js | 96 +++++++++++ ...tatic-method-privatename-identifier-alt.js | 115 +++++++++++++ ...rs-static-method-privatename-identifier.js | 109 ++++++++++++ ...sc-rs-static-privatename-identifier-alt.js | 97 +++++++++++ ...-privatename-identifier-initializer-alt.js | 91 ++++++++++ ...atic-privatename-identifier-initializer.js | 91 ++++++++++ ...-in-sc-rs-static-privatename-identifier.js | 97 +++++++++++ ...grammar-field-def-has-initializer-no-sc.js | 31 ++++ ...rammar-field-no-initializer-with-method.js | 32 ++++ .../class/syntax-error-grammar-fields.js | 31 ++++ ...-privatename-no-initializer-with-method.js | 35 ++++ .../class/syntax-error-grammar-privatename.js | 34 ++++ .../syntax-error-grammar-privatenames.js | 34 ++++ ...r-field-def-has-initializer-no-sc-error.js | 35 ++++ ...mmar-field-identifier-invalid-ues-error.js | 71 ++++++++ ...mmar-field-identifier-invalid-zwj-error.js | 71 ++++++++ ...mar-field-identifier-invalid-zwnj-error.js | 71 ++++++++ ...-invalid-grammar-fields-same-line-error.js | 34 ++++ ...yntax-invalid-grammar-privatename-error.js | 37 ++++ ...mmar-privatename-identifier-invalid-ues.js | 65 +++++++ ...rivatename-identifier-invalid-zwj-error.js | 66 ++++++++ ...ivatename-identifier-invalid-zwnj-error.js | 66 ++++++++ ...ivatename-identifier-non-id-start-error.js | 65 +++++++ ...ar-privatename-identifier-non-ues-error.js | 65 +++++++ ...id-grammar-privatenames-same-line-error.js | 37 ++++ ...-field-classelementname-initializer-alt.js | 71 ++++++++ ...mmar-field-classelementname-initializer.js | 71 ++++++++ ...ntax-valid-grammar-field-identifier-alt.js | 71 ++++++++ .../syntax-valid-grammar-field-identifier.js | 71 ++++++++ .../syntax-valid-grammar-fields-multi-line.js | 30 ++++ ...tename-classelementname-initializer-alt.js | 68 ++++++++ ...rivatename-classelementname-initializer.js | 68 ++++++++ ...ax-valid-grammar-privatename-identifier.js | 65 +++++++ ...-privatename-no-initializer-with-method.js | 33 ++++ ...x-valid-grammar-privatenames-multi-line.js | 33 ++++ ...tename-identifier-semantics-stringvalue.js | 105 ++++++++++++ ...ine-gen-rs-field-identifier-initializer.js | 83 +++++++++ ...after-same-line-gen-rs-field-identifier.js | 90 ++++++++++ ...-line-gen-rs-privatename-identifier-alt.js | 105 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 99 +++++++++++ ...n-rs-privatename-identifier-initializer.js | 99 +++++++++++ ...same-line-gen-rs-privatename-identifier.js | 105 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 124 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 118 +++++++++++++ ...en-rs-static-privatename-identifier-alt.js | 106 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 100 +++++++++++ ...atic-privatename-identifier-initializer.js | 100 +++++++++++ ...ne-gen-rs-static-privatename-identifier.js | 106 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 105 ++++++++++++ ...-method-rs-field-identifier-initializer.js | 83 +++++++++ ...er-same-line-method-rs-field-identifier.js | 90 ++++++++++ ...ne-method-rs-privatename-identifier-alt.js | 105 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 99 +++++++++++ ...d-rs-privatename-identifier-initializer.js | 99 +++++++++++ ...e-line-method-rs-privatename-identifier.js | 105 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 124 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 118 +++++++++++++ ...od-rs-static-privatename-identifier-alt.js | 106 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 100 +++++++++++ ...atic-privatename-identifier-initializer.js | 100 +++++++++++ ...method-rs-static-privatename-identifier.js | 106 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 109 ++++++++++++ ...ync-gen-rs-field-identifier-initializer.js | 87 ++++++++++ ...ne-static-async-gen-rs-field-identifier.js | 94 ++++++++++ ...async-gen-rs-privatename-identifier-alt.js | 109 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 103 +++++++++++ ...n-rs-privatename-identifier-initializer.js | 103 +++++++++++ ...tic-async-gen-rs-privatename-identifier.js | 109 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 128 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 122 +++++++++++++ ...en-rs-static-privatename-identifier-alt.js | 110 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 104 ++++++++++++ ...atic-privatename-identifier-initializer.js | 104 ++++++++++++ ...nc-gen-rs-static-privatename-identifier.js | 110 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 108 ++++++++++++ ...-method-rs-field-identifier-initializer.js | 86 ++++++++++ ...static-async-method-rs-field-identifier.js | 93 ++++++++++ ...nc-method-rs-privatename-identifier-alt.js | 108 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 102 +++++++++++ ...d-rs-privatename-identifier-initializer.js | 102 +++++++++++ ...-async-method-rs-privatename-identifier.js | 108 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 127 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 121 +++++++++++++ ...od-rs-static-privatename-identifier-alt.js | 109 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 103 +++++++++++ ...atic-privatename-identifier-initializer.js | 103 +++++++++++ ...method-rs-static-privatename-identifier.js | 109 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 105 ++++++++++++ ...tic-gen-rs-field-identifier-initializer.js | 83 +++++++++ ...ame-line-static-gen-rs-field-identifier.js | 90 ++++++++++ ...tatic-gen-rs-privatename-identifier-alt.js | 105 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 99 +++++++++++ ...n-rs-privatename-identifier-initializer.js | 99 +++++++++++ ...ne-static-gen-rs-privatename-identifier.js | 105 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 124 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 118 +++++++++++++ ...en-rs-static-privatename-identifier-alt.js | 106 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 100 +++++++++++ ...atic-privatename-identifier-initializer.js | 100 +++++++++++ ...ic-gen-rs-static-privatename-identifier.js | 106 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 105 ++++++++++++ ...-method-rs-field-identifier-initializer.js | 83 +++++++++ ...-line-static-method-rs-field-identifier.js | 90 ++++++++++ ...ic-method-rs-privatename-identifier-alt.js | 105 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 99 +++++++++++ ...d-rs-privatename-identifier-initializer.js | 99 +++++++++++ ...static-method-rs-privatename-identifier.js | 105 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 124 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 118 +++++++++++++ ...od-rs-static-privatename-identifier-alt.js | 106 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 100 +++++++++++ ...atic-privatename-identifier-initializer.js | 100 +++++++++++ ...method-rs-static-privatename-identifier.js | 106 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 141 +++++++++++++++ ...nitions-rs-field-identifier-initializer.js | 119 +++++++++++++ ...ultiple-definitions-rs-field-identifier.js | 126 ++++++++++++++ ...finitions-rs-privatename-identifier-alt.js | 141 +++++++++++++++ ...-privatename-identifier-initializer-alt.js | 135 +++++++++++++++ ...s-rs-privatename-identifier-initializer.js | 135 +++++++++++++++ ...e-definitions-rs-privatename-identifier.js | 141 +++++++++++++++ ...tatic-method-privatename-identifier-alt.js | 160 ++++++++++++++++++ ...rs-static-method-privatename-identifier.js | 154 +++++++++++++++++ ...ns-rs-static-privatename-identifier-alt.js | 142 ++++++++++++++++ ...-privatename-identifier-initializer-alt.js | 136 +++++++++++++++ ...atic-privatename-identifier-initializer.js | 136 +++++++++++++++ ...itions-rs-static-privatename-identifier.js | 142 ++++++++++++++++ ...tename-identifier-semantics-stringvalue.js | 119 +++++++++++++ ...nitions-rs-field-identifier-initializer.js | 97 +++++++++++ ...stacked-definitions-rs-field-identifier.js | 104 ++++++++++++ ...finitions-rs-privatename-identifier-alt.js | 119 +++++++++++++ ...-privatename-identifier-initializer-alt.js | 113 +++++++++++++ ...s-rs-privatename-identifier-initializer.js | 113 +++++++++++++ ...d-definitions-rs-privatename-identifier.js | 119 +++++++++++++ ...tatic-method-privatename-identifier-alt.js | 138 +++++++++++++++ ...rs-static-method-privatename-identifier.js | 132 +++++++++++++++ ...ns-rs-static-privatename-identifier-alt.js | 120 +++++++++++++ ...-privatename-identifier-initializer-alt.js | 114 +++++++++++++ ...atic-privatename-identifier-initializer.js | 114 +++++++++++++ ...itions-rs-static-privatename-identifier.js | 120 +++++++++++++ ...tename-identifier-semantics-stringvalue.js | 106 ++++++++++++ ...-method-rs-field-identifier-initializer.js | 84 +++++++++ ...w-no-sc-line-method-rs-field-identifier.js | 91 ++++++++++ ...ne-method-rs-privatename-identifier-alt.js | 106 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 100 +++++++++++ ...d-rs-privatename-identifier-initializer.js | 100 +++++++++++ ...c-line-method-rs-privatename-identifier.js | 106 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 125 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 119 +++++++++++++ ...od-rs-static-privatename-identifier-alt.js | 107 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 101 +++++++++++ ...atic-privatename-identifier-initializer.js | 101 +++++++++++ ...method-rs-static-privatename-identifier.js | 107 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 106 ++++++++++++ ...ine-gen-rs-field-identifier-initializer.js | 84 +++++++++ ...lds-new-sc-line-gen-rs-field-identifier.js | 91 ++++++++++ ...-line-gen-rs-privatename-identifier-alt.js | 106 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 100 +++++++++++ ...n-rs-privatename-identifier-initializer.js | 100 +++++++++++ ...w-sc-line-gen-rs-privatename-identifier.js | 106 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 125 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 119 +++++++++++++ ...en-rs-static-privatename-identifier-alt.js | 107 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 101 +++++++++++ ...atic-privatename-identifier-initializer.js | 101 +++++++++++ ...ne-gen-rs-static-privatename-identifier.js | 107 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 106 ++++++++++++ ...-method-rs-field-identifier-initializer.js | 84 +++++++++ ...-new-sc-line-method-rs-field-identifier.js | 91 ++++++++++ ...ne-method-rs-privatename-identifier-alt.js | 106 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 100 +++++++++++ ...d-rs-privatename-identifier-initializer.js | 100 +++++++++++ ...c-line-method-rs-privatename-identifier.js | 106 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 125 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 119 +++++++++++++ ...od-rs-static-privatename-identifier-alt.js | 107 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 101 +++++++++++ ...atic-privatename-identifier-initializer.js | 101 +++++++++++ ...method-rs-static-privatename-identifier.js | 107 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 94 ++++++++++ ...nitions-rs-field-identifier-initializer.js | 72 ++++++++ ...regular-definitions-rs-field-identifier.js | 79 +++++++++ ...finitions-rs-privatename-identifier-alt.js | 94 ++++++++++ ...-privatename-identifier-initializer-alt.js | 88 ++++++++++ ...s-rs-privatename-identifier-initializer.js | 88 ++++++++++ ...r-definitions-rs-privatename-identifier.js | 94 ++++++++++ ...tatic-method-privatename-identifier-alt.js | 113 +++++++++++++ ...rs-static-method-privatename-identifier.js | 107 ++++++++++++ ...ns-rs-static-privatename-identifier-alt.js | 95 +++++++++++ ...-privatename-identifier-initializer-alt.js | 89 ++++++++++ ...atic-privatename-identifier-initializer.js | 89 ++++++++++ ...itions-rs-static-privatename-identifier.js | 95 +++++++++++ ...tename-identifier-semantics-stringvalue.js | 109 ++++++++++++ ...ync-gen-rs-field-identifier-initializer.js | 87 ++++++++++ ...same-line-async-gen-rs-field-identifier.js | 94 ++++++++++ ...async-gen-rs-privatename-identifier-alt.js | 109 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 103 +++++++++++ ...n-rs-privatename-identifier-initializer.js | 103 +++++++++++ ...ine-async-gen-rs-privatename-identifier.js | 109 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 128 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 122 +++++++++++++ ...en-rs-static-privatename-identifier-alt.js | 110 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 104 ++++++++++++ ...atic-privatename-identifier-initializer.js | 104 ++++++++++++ ...nc-gen-rs-static-privatename-identifier.js | 110 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 108 ++++++++++++ ...-method-rs-field-identifier-initializer.js | 86 ++++++++++ ...e-line-async-method-rs-field-identifier.js | 93 ++++++++++ ...nc-method-rs-privatename-identifier-alt.js | 108 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 102 +++++++++++ ...d-rs-privatename-identifier-initializer.js | 102 +++++++++++ ...-async-method-rs-privatename-identifier.js | 108 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 127 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 121 +++++++++++++ ...od-rs-static-privatename-identifier-alt.js | 109 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 103 +++++++++++ ...atic-privatename-identifier-initializer.js | 103 +++++++++++ ...method-rs-static-privatename-identifier.js | 109 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 105 ++++++++++++ ...ine-gen-rs-field-identifier-initializer.js | 83 +++++++++ ...ields-same-line-gen-rs-field-identifier.js | 90 ++++++++++ ...-line-gen-rs-privatename-identifier-alt.js | 105 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 99 +++++++++++ ...n-rs-privatename-identifier-initializer.js | 99 +++++++++++ ...same-line-gen-rs-privatename-identifier.js | 105 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 124 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 118 +++++++++++++ ...en-rs-static-privatename-identifier-alt.js | 106 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 100 +++++++++++ ...atic-privatename-identifier-initializer.js | 100 +++++++++++ ...ne-gen-rs-static-privatename-identifier.js | 106 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 105 ++++++++++++ ...-method-rs-field-identifier-initializer.js | 83 +++++++++ ...ds-same-line-method-rs-field-identifier.js | 90 ++++++++++ ...ne-method-rs-privatename-identifier-alt.js | 105 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 99 +++++++++++ ...d-rs-privatename-identifier-initializer.js | 99 +++++++++++ ...e-line-method-rs-privatename-identifier.js | 105 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 124 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 118 +++++++++++++ ...od-rs-static-privatename-identifier-alt.js | 106 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 100 +++++++++++ ...atic-privatename-identifier-initializer.js | 100 +++++++++++ ...method-rs-static-privatename-identifier.js | 106 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 96 +++++++++++ ...d-in-sc-rs-field-identifier-initializer.js | 74 ++++++++ ...ields-wrapped-in-sc-rs-field-identifier.js | 81 +++++++++ ...ped-in-sc-rs-privatename-identifier-alt.js | 96 +++++++++++ ...-privatename-identifier-initializer-alt.js | 90 ++++++++++ ...c-rs-privatename-identifier-initializer.js | 90 ++++++++++ ...wrapped-in-sc-rs-privatename-identifier.js | 96 +++++++++++ ...tatic-method-privatename-identifier-alt.js | 115 +++++++++++++ ...rs-static-method-privatename-identifier.js | 109 ++++++++++++ ...sc-rs-static-privatename-identifier-alt.js | 97 +++++++++++ ...-privatename-identifier-initializer-alt.js | 91 ++++++++++ ...atic-privatename-identifier-initializer.js | 91 ++++++++++ ...-in-sc-rs-static-privatename-identifier.js | 97 +++++++++++ ...grammar-field-def-has-initializer-no-sc.js | 31 ++++ ...rammar-field-no-initializer-with-method.js | 32 ++++ .../class/syntax-error-grammar-fields.js | 31 ++++ ...-privatename-no-initializer-with-method.js | 35 ++++ .../class/syntax-error-grammar-privatename.js | 34 ++++ .../syntax-error-grammar-privatenames.js | 34 ++++ ...r-field-def-has-initializer-no-sc-error.js | 35 ++++ ...mmar-field-identifier-invalid-ues-error.js | 71 ++++++++ ...mmar-field-identifier-invalid-zwj-error.js | 71 ++++++++ ...mar-field-identifier-invalid-zwnj-error.js | 71 ++++++++ ...-invalid-grammar-fields-same-line-error.js | 34 ++++ ...yntax-invalid-grammar-privatename-error.js | 37 ++++ ...mmar-privatename-identifier-invalid-ues.js | 65 +++++++ ...rivatename-identifier-invalid-zwj-error.js | 66 ++++++++ ...ivatename-identifier-invalid-zwnj-error.js | 66 ++++++++ ...ivatename-identifier-non-id-start-error.js | 65 +++++++ ...ar-privatename-identifier-non-ues-error.js | 65 +++++++ ...id-grammar-privatenames-same-line-error.js | 37 ++++ ...-field-classelementname-initializer-alt.js | 71 ++++++++ ...mmar-field-classelementname-initializer.js | 71 ++++++++ ...ntax-valid-grammar-field-identifier-alt.js | 71 ++++++++ .../syntax-valid-grammar-field-identifier.js | 71 ++++++++ .../syntax-valid-grammar-fields-multi-line.js | 30 ++++ ...tename-classelementname-initializer-alt.js | 68 ++++++++ ...rivatename-classelementname-initializer.js | 68 ++++++++ ...ax-valid-grammar-privatename-identifier.js | 65 +++++++ ...-privatename-no-initializer-with-method.js | 33 ++++ ...x-valid-grammar-privatenames-multi-line.js | 33 ++++ 498 files changed, 49704 insertions(+) create mode 100644 test/language/expressions/class/fields-after-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/expressions/class/fields-after-same-line-gen-rs-field-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-after-same-line-gen-rs-field-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-gen-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-gen-rs-static-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-rs-field-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-rs-field-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-rs-static-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-rs-field-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-rs-field-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-rs-field-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-rs-field-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-rs-field-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-rs-field-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-rs-field-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-rs-field-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-rs-field-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-rs-field-identifier.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-rs-static-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-rs-field-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-rs-field-identifier.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-rs-field-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-rs-field-identifier.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-rs-field-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-rs-field-identifier.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-rs-field-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-rs-field-identifier.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-rs-static-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-regular-definitions-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/expressions/class/fields-regular-definitions-rs-field-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-regular-definitions-rs-field-identifier.js create mode 100644 test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-regular-definitions-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-regular-definitions-rs-static-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-rs-field-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-rs-field-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-rs-static-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-rs-field-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-rs-field-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-rs-static-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/expressions/class/fields-same-line-gen-rs-field-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-same-line-gen-rs-field-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-gen-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-same-line-gen-rs-static-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/expressions/class/fields-same-line-method-rs-field-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-same-line-method-rs-field-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-method-rs-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-same-line-method-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-same-line-method-rs-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-same-line-method-rs-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-method-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-same-line-method-rs-static-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-rs-field-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-rs-field-identifier.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier.js create mode 100644 test/language/expressions/class/syntax-error-grammar-field-def-has-initializer-no-sc.js create mode 100644 test/language/expressions/class/syntax-error-grammar-field-no-initializer-with-method.js create mode 100644 test/language/expressions/class/syntax-error-grammar-fields.js create mode 100644 test/language/expressions/class/syntax-error-grammar-privatename-no-initializer-with-method.js create mode 100644 test/language/expressions/class/syntax-error-grammar-privatename.js create mode 100644 test/language/expressions/class/syntax-error-grammar-privatenames.js create mode 100644 test/language/expressions/class/syntax-invalid-grammar-field-def-has-initializer-no-sc-error.js create mode 100644 test/language/expressions/class/syntax-invalid-grammar-field-identifier-invalid-ues-error.js create mode 100644 test/language/expressions/class/syntax-invalid-grammar-field-identifier-invalid-zwj-error.js create mode 100644 test/language/expressions/class/syntax-invalid-grammar-field-identifier-invalid-zwnj-error.js create mode 100644 test/language/expressions/class/syntax-invalid-grammar-fields-same-line-error.js create mode 100644 test/language/expressions/class/syntax-invalid-grammar-privatename-error.js create mode 100644 test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-invalid-ues.js create mode 100644 test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-invalid-zwj-error.js create mode 100644 test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-invalid-zwnj-error.js create mode 100644 test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-non-id-start-error.js create mode 100644 test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-non-ues-error.js create mode 100644 test/language/expressions/class/syntax-invalid-grammar-privatenames-same-line-error.js create mode 100644 test/language/expressions/class/syntax-valid-grammar-field-classelementname-initializer-alt.js create mode 100644 test/language/expressions/class/syntax-valid-grammar-field-classelementname-initializer.js create mode 100644 test/language/expressions/class/syntax-valid-grammar-field-identifier-alt.js create mode 100644 test/language/expressions/class/syntax-valid-grammar-field-identifier.js create mode 100644 test/language/expressions/class/syntax-valid-grammar-fields-multi-line.js create mode 100644 test/language/expressions/class/syntax-valid-grammar-privatename-classelementname-initializer-alt.js create mode 100644 test/language/expressions/class/syntax-valid-grammar-privatename-classelementname-initializer.js create mode 100644 test/language/expressions/class/syntax-valid-grammar-privatename-identifier.js create mode 100644 test/language/expressions/class/syntax-valid-grammar-privatename-no-initializer-with-method.js create mode 100644 test/language/expressions/class/syntax-valid-grammar-privatenames-multi-line.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-rs-field-identifier-initializer.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-rs-field-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-rs-static-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/statements/class/fields-after-same-line-method-rs-field-identifier-initializer.js create mode 100644 test/language/statements/class/fields-after-same-line-method-rs-field-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-method-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-method-rs-static-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-rs-field-identifier-initializer.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-rs-field-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-rs-field-identifier-initializer.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-rs-field-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-rs-field-identifier-initializer.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-rs-field-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-rs-field-identifier-initializer.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-rs-field-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier.js create mode 100644 test/language/statements/class/fields-multiple-definitions-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/statements/class/fields-multiple-definitions-rs-field-identifier-initializer.js create mode 100644 test/language/statements/class/fields-multiple-definitions-rs-field-identifier.js create mode 100644 test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier.js create mode 100644 test/language/statements/class/fields-multiple-definitions-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-multiple-definitions-rs-static-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-rs-field-identifier-initializer.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-rs-field-identifier.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-rs-field-identifier-initializer.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-rs-field-identifier.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-rs-field-identifier-initializer.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-rs-field-identifier.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-rs-field-identifier-initializer.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-rs-field-identifier.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-rs-static-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier.js create mode 100644 test/language/statements/class/fields-regular-definitions-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/statements/class/fields-regular-definitions-rs-field-identifier-initializer.js create mode 100644 test/language/statements/class/fields-regular-definitions-rs-field-identifier.js create mode 100644 test/language/statements/class/fields-regular-definitions-rs-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-regular-definitions-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-regular-definitions-rs-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-regular-definitions-rs-privatename-identifier.js create mode 100644 test/language/statements/class/fields-regular-definitions-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-regular-definitions-rs-static-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-rs-field-identifier-initializer.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-rs-field-identifier.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-rs-static-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier.js create mode 100644 test/language/statements/class/fields-same-line-async-method-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/statements/class/fields-same-line-async-method-rs-field-identifier-initializer.js create mode 100644 test/language/statements/class/fields-same-line-async-method-rs-field-identifier.js create mode 100644 test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier.js create mode 100644 test/language/statements/class/fields-same-line-async-method-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-same-line-async-method-rs-static-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier.js create mode 100644 test/language/statements/class/fields-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/statements/class/fields-same-line-gen-rs-field-identifier-initializer.js create mode 100644 test/language/statements/class/fields-same-line-gen-rs-field-identifier.js create mode 100644 test/language/statements/class/fields-same-line-gen-rs-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-same-line-gen-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-same-line-gen-rs-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-same-line-gen-rs-privatename-identifier.js create mode 100644 test/language/statements/class/fields-same-line-gen-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-same-line-gen-rs-static-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier.js create mode 100644 test/language/statements/class/fields-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/statements/class/fields-same-line-method-rs-field-identifier-initializer.js create mode 100644 test/language/statements/class/fields-same-line-method-rs-field-identifier.js create mode 100644 test/language/statements/class/fields-same-line-method-rs-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-same-line-method-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-same-line-method-rs-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-same-line-method-rs-privatename-identifier.js create mode 100644 test/language/statements/class/fields-same-line-method-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-same-line-method-rs-static-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-rs-field-identifier-initializer.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-rs-field-identifier.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier.js create mode 100644 test/language/statements/class/syntax-error-grammar-field-def-has-initializer-no-sc.js create mode 100644 test/language/statements/class/syntax-error-grammar-field-no-initializer-with-method.js create mode 100644 test/language/statements/class/syntax-error-grammar-fields.js create mode 100644 test/language/statements/class/syntax-error-grammar-privatename-no-initializer-with-method.js create mode 100644 test/language/statements/class/syntax-error-grammar-privatename.js create mode 100644 test/language/statements/class/syntax-error-grammar-privatenames.js create mode 100644 test/language/statements/class/syntax-invalid-grammar-field-def-has-initializer-no-sc-error.js create mode 100644 test/language/statements/class/syntax-invalid-grammar-field-identifier-invalid-ues-error.js create mode 100644 test/language/statements/class/syntax-invalid-grammar-field-identifier-invalid-zwj-error.js create mode 100644 test/language/statements/class/syntax-invalid-grammar-field-identifier-invalid-zwnj-error.js create mode 100644 test/language/statements/class/syntax-invalid-grammar-fields-same-line-error.js create mode 100644 test/language/statements/class/syntax-invalid-grammar-privatename-error.js create mode 100644 test/language/statements/class/syntax-invalid-grammar-privatename-identifier-invalid-ues.js create mode 100644 test/language/statements/class/syntax-invalid-grammar-privatename-identifier-invalid-zwj-error.js create mode 100644 test/language/statements/class/syntax-invalid-grammar-privatename-identifier-invalid-zwnj-error.js create mode 100644 test/language/statements/class/syntax-invalid-grammar-privatename-identifier-non-id-start-error.js create mode 100644 test/language/statements/class/syntax-invalid-grammar-privatename-identifier-non-ues-error.js create mode 100644 test/language/statements/class/syntax-invalid-grammar-privatenames-same-line-error.js create mode 100644 test/language/statements/class/syntax-valid-grammar-field-classelementname-initializer-alt.js create mode 100644 test/language/statements/class/syntax-valid-grammar-field-classelementname-initializer.js create mode 100644 test/language/statements/class/syntax-valid-grammar-field-identifier-alt.js create mode 100644 test/language/statements/class/syntax-valid-grammar-field-identifier.js create mode 100644 test/language/statements/class/syntax-valid-grammar-fields-multi-line.js create mode 100644 test/language/statements/class/syntax-valid-grammar-privatename-classelementname-initializer-alt.js create mode 100644 test/language/statements/class/syntax-valid-grammar-privatename-classelementname-initializer.js create mode 100644 test/language/statements/class/syntax-valid-grammar-privatename-identifier.js create mode 100644 test/language/statements/class/syntax-valid-grammar-privatename-no-initializer-with-method.js create mode 100644 test/language/statements/class/syntax-valid-grammar-privatenames-multi-line.js diff --git a/test/language/expressions/class/fields-after-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-after-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..abc30af89f --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-expr-after-same-line-gen.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +var C = class { + *m() { return 42; } #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-gen-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..4c9cb38386 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-field-identifier-initializer.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-gen.template +/*--- +description: Valid FieldDefinition (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + *m() { return 42; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-field-identifier.js b/test/language/expressions/class/fields-after-same-line-gen-rs-field-identifier.js new file mode 100644 index 0000000000..f4cd4bdd9e --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-field-identifier.js @@ -0,0 +1,90 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-gen.template +/*--- +description: Valid FieldDefinition (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + *m() { return 42; } $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..a75596b0d0 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier-alt.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-gen.template +/*--- +description: Valid PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + *m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..17896a22bd --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-gen.template +/*--- +description: Valid PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..c0ee0b4924 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier-initializer.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-gen.template +/*--- +description: Valid PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier.js new file mode 100644 index 0000000000..fafb30e5ea --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-gen.template +/*--- +description: Valid PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + *m() { return 42; } #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-gen-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..e3c927ecaa --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-gen.template +/*--- +description: Valid Static Method PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + *m() { return 42; } static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-gen-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..f583254b5b --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-static-method-privatename-identifier.js @@ -0,0 +1,118 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-gen.template +/*--- +description: Valid Static Method PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + *m() { return 42; } static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..46d1a107a4 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-alt.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + *m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..cb66f59c8a --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..9cf2145b03 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..18aa8bd979 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + *m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-after-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..7dec72eaa0 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-expr-after-same-line-method.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +var C = class { + m() { return 42; } #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-method-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..0a0fdebfdc --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-rs-field-identifier-initializer.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-method.template +/*--- +description: Valid FieldDefinition (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + m() { return 42; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-field-identifier.js b/test/language/expressions/class/fields-after-same-line-method-rs-field-identifier.js new file mode 100644 index 0000000000..89cd17b992 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-rs-field-identifier.js @@ -0,0 +1,90 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-method.template +/*--- +description: Valid FieldDefinition (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + m() { return 42; } $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..b5ea3953f9 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier-alt.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-method.template +/*--- +description: Valid PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..8c11ae4160 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-method.template +/*--- +description: Valid PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..ee9058804f --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier-initializer.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-method.template +/*--- +description: Valid PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier.js new file mode 100644 index 0000000000..b8985cd3b4 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-method.template +/*--- +description: Valid PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + m() { return 42; } #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-method-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..a450a689d0 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-method.template +/*--- +description: Valid Static Method PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + m() { return 42; } static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-method-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..5b00501645 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-rs-static-method-privatename-identifier.js @@ -0,0 +1,118 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-method.template +/*--- +description: Valid Static Method PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + m() { return 42; } static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..57b8d679a3 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-alt.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..398218314b --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..ca2286d78f --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..172bc77851 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..3fac03c1e5 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +var C = class { + static async *m() { return 42; } #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..ebdad02016 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-field-identifier-initializer.js @@ -0,0 +1,87 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Valid FieldDefinition (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static async *m() { return 42; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-field-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-field-identifier.js new file mode 100644 index 0000000000..5d6cc1dede --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-field-identifier.js @@ -0,0 +1,94 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Valid FieldDefinition (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static async *m() { return 42; } $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..9bceb8ad1f --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-alt.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Valid PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static async *m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..43143675db --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,103 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Valid PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static async *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..8e3a001a3d --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer.js @@ -0,0 +1,103 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Valid PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static async *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier.js new file mode 100644 index 0000000000..c8e9e4a152 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Valid PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static async *m() { return 42; } #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..c3adc2883a --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,128 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Valid Static Method PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static async *m() { return 42; } static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..2e339ebfe3 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier.js @@ -0,0 +1,122 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Valid Static Method PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static async *m() { return 42; } static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..cefca0895d --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt.js @@ -0,0 +1,110 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static async *m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..cf52bf9422 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,104 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static async *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..650296ac2b --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,104 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static async *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..6f82a68b6a --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier.js @@ -0,0 +1,110 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static async *m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-after-same-line-static-async-method-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..a124cb4b34 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,108 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +var C = class { + static async m() { return 42; } #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..6ab83cfbd0 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-field-identifier-initializer.js @@ -0,0 +1,86 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Valid FieldDefinition (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static async m() { return 42; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-field-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-field-identifier.js new file mode 100644 index 0000000000..1913470f62 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-field-identifier.js @@ -0,0 +1,93 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Valid FieldDefinition (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static async m() { return 42; } $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..c319e0f2e9 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-alt.js @@ -0,0 +1,108 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Valid PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static async m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..27b99bc832 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,102 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Valid PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static async m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..b8e4f8304e --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer.js @@ -0,0 +1,102 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Valid PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static async m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier.js new file mode 100644 index 0000000000..ce08f25507 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier.js @@ -0,0 +1,108 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Valid PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static async m() { return 42; } #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..3393a2553d --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,127 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Valid Static Method PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static async m() { return 42; } static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..946645e069 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier.js @@ -0,0 +1,121 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Valid Static Method PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static async m() { return 42; } static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..413a1fc6f0 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static async m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..dd25aee729 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,103 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static async m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..5f13258900 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,103 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static async m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..a40dcffc39 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static async m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-after-same-line-static-gen-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..a3985c5b61 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +var C = class { + static *m() { return 42; } #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..1af61bd812 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-field-identifier-initializer.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Valid FieldDefinition (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static *m() { return 42; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; + +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-field-identifier.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-field-identifier.js new file mode 100644 index 0000000000..3c8431712e --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-field-identifier.js @@ -0,0 +1,90 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Valid FieldDefinition (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static *m() { return 42; } $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; + +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..ce0b449d92 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier-alt.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Valid PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static *m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..0ce52d94e5 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Valid PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..3134c68851 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Valid PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier.js new file mode 100644 index 0000000000..af70e7e929 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Valid PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static *m() { return 42; } #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..f282f026aa --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Valid Static Method PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static *m() { return 42; } static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..b82b9c0105 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier.js @@ -0,0 +1,118 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Valid Static Method PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static *m() { return 42; } static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..f28b29fb0a --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-alt.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static *m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..dbc6e893cc --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..d8849231f6 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..0e240f1e59 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static *m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-static-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-after-same-line-static-method-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..c9d3d3aa49 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +var C = class { + static m() { return 42; } #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..6a2095badb --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-field-identifier-initializer.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Valid FieldDefinition (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static m() { return 42; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; + +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-field-identifier.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-field-identifier.js new file mode 100644 index 0000000000..136b3c42f9 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-field-identifier.js @@ -0,0 +1,90 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Valid FieldDefinition (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static m() { return 42; } $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; + +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..79caa36ce4 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier-alt.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Valid PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..c94c0151ad --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Valid PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..d22e890101 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Valid PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier.js new file mode 100644 index 0000000000..60c062b25b --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Valid PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static m() { return 42; } #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..4190a189f9 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Valid Static Method PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static m() { return 42; } static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..0195586210 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier.js @@ -0,0 +1,118 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Valid Static Method PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static m() { return 42; } static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..b2e00cc339 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-alt.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..69b632cd70 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..2e22625d06 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..1dded9c225 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-multiple-definitions-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-multiple-definitions-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..0712be6cc6 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,141 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-expr-multiple-definitions.template +/*--- +description: PrivateName Static Semantics, StringValue (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J; + m2() { return 39 } + bar = "barbaz"; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-multiple-definitions-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..632c8c119b --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-rs-field-identifier-initializer.js @@ -0,0 +1,119 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-expr-multiple-definitions.template +/*--- +description: Valid FieldDefinition (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1 + m2() { return 39 } + bar = "barbaz"; + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-field-identifier.js b/test/language/expressions/class/fields-multiple-definitions-rs-field-identifier.js new file mode 100644 index 0000000000..93f5643f5a --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-rs-field-identifier.js @@ -0,0 +1,126 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-expr-multiple-definitions.template +/*--- +description: Valid FieldDefinition (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J + m2() { return 39 } + bar = "barbaz"; + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..7052d732da --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier-alt.js @@ -0,0 +1,141 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-multiple-definitions.template +/*--- +description: Valid PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J + m2() { return 39 } + bar = "barbaz"; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..739ce1027a --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,135 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-multiple-definitions.template +/*--- +description: Valid PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1 + m2() { return 39 } + bar = "barbaz"; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..dcb8bd0091 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier-initializer.js @@ -0,0 +1,135 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-multiple-definitions.template +/*--- +description: Valid PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1 + m2() { return 39 } + bar = "barbaz"; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier.js b/test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier.js new file mode 100644 index 0000000000..7f418d1f4c --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier.js @@ -0,0 +1,141 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-expr-multiple-definitions.template +/*--- +description: Valid PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J + m2() { return 39 } + bar = "barbaz"; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-multiple-definitions-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..8d63cb93eb --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,160 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-multiple-definitions.template +/*--- +description: Valid Static Method PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + } + m2() { return 39 } + bar = "barbaz"; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-multiple-definitions-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..1cd184c5c7 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-rs-static-method-privatename-identifier.js @@ -0,0 +1,154 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-multiple-definitions.template +/*--- +description: Valid Static Method PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + } + m2() { return 39 } + bar = "barbaz"; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..b3a0eb1889 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-alt.js @@ -0,0 +1,142 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-multiple-definitions.template +/*--- +description: Valid Static PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J + m2() { return 39 } + bar = "barbaz"; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..6839f876e9 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,136 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-multiple-definitions.template +/*--- +description: Valid Static PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1 + m2() { return 39 } + bar = "barbaz"; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..0c388f3982 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,136 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-multiple-definitions.template +/*--- +description: Valid Static PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1 + m2() { return 39 } + bar = "barbaz"; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..644647bd0d --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier.js @@ -0,0 +1,142 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-expr-multiple-definitions.template +/*--- +description: Valid Static PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J + m2() { return 39 } + bar = "barbaz"; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-multiple-stacked-definitions-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..f555657293 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,119 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: PrivateName Static Semantics, StringValue (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +var C = class { + #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J; + foo = "foobar" + bar = "barbaz"; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..0ebd53481d --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-field-identifier-initializer.js @@ -0,0 +1,97 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Valid FieldDefinition (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1 + foo = "foobar" + bar = "barbaz"; + +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-field-identifier.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-field-identifier.js new file mode 100644 index 0000000000..bbf70435d5 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-field-identifier.js @@ -0,0 +1,104 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Valid FieldDefinition (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J + foo = "foobar" + bar = "barbaz"; + +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..602aa8cd56 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier-alt.js @@ -0,0 +1,119 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Valid PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J + foo = "foobar" + bar = "barbaz"; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..0e6bdc88f5 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,113 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Valid PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1 + foo = "foobar" + bar = "barbaz"; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..803bdbe03b --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer.js @@ -0,0 +1,113 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Valid PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1 + foo = "foobar" + bar = "barbaz"; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier.js new file mode 100644 index 0000000000..e28f81ae7b --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier.js @@ -0,0 +1,119 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Valid PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J + foo = "foobar" + bar = "barbaz"; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..385f8bd798 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,138 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Valid Static Method PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + } + foo = "foobar" + bar = "barbaz"; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..f2cd4be402 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier.js @@ -0,0 +1,132 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Valid Static Method PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + } + foo = "foobar" + bar = "barbaz"; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..e476161bd0 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-alt.js @@ -0,0 +1,120 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Valid Static PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J + foo = "foobar" + bar = "barbaz"; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..ab1705896e --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,114 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Valid Static PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1 + foo = "foobar" + bar = "barbaz"; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..b8916c68b5 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,114 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Valid Static PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1 + foo = "foobar" + bar = "barbaz"; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..7ece03a60f --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier.js @@ -0,0 +1,120 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Valid Static PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J + foo = "foobar" + bar = "barbaz"; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-new-no-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..d1379b96ba --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +var C = class { + #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J; + m() { return 42; } + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..33368c9728 --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-field-identifier-initializer.js @@ -0,0 +1,84 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Valid FieldDefinition (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1 + m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-field-identifier.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-field-identifier.js new file mode 100644 index 0000000000..038b2feb76 --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-field-identifier.js @@ -0,0 +1,91 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Valid FieldDefinition (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J + m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..fa5056e237 --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier-alt.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J + m() { return 42; } + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..6a082a7b0c --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1 + m() { return 42; } + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..af503cae70 --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1 + m() { return 42; } + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier.js new file mode 100644 index 0000000000..f3d0cbb698 --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J + m() { return 42; } + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..d6b0423dbb --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,125 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Valid Static Method PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + } + m() { return 42; } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..42383a312e --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier.js @@ -0,0 +1,119 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Valid Static Method PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + } + m() { return 42; } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..83e9e56b31 --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-alt.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J + m() { return 42; } + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..aa5f913d2c --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,101 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1 + m() { return 42; } + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..28d9712a7e --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,101 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1 + m() { return 42; } + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..be24db224f --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J + m() { return 42; } + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-new-sc-line-gen-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-new-sc-line-gen-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..ec6fa5ac28 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +var C = class { + #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; + *m() { return 42; } + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..c20042d7b9 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-field-identifier-initializer.js @@ -0,0 +1,84 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Valid FieldDefinition (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; + *m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-field-identifier.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-field-identifier.js new file mode 100644 index 0000000000..9d90b1932c --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-field-identifier.js @@ -0,0 +1,91 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Valid FieldDefinition (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; + *m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..b3f83f12e2 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier-alt.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; + *m() { return 42; } + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..5a7ed4f9d7 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; + *m() { return 42; } + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..131e929802 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; + *m() { return 42; } + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier.js new file mode 100644 index 0000000000..303faedec2 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; + *m() { return 42; } + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..34b6e8aad9 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,125 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Valid Static Method PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; + *m() { return 42; } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..c35499141e --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier.js @@ -0,0 +1,119 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Valid Static Method PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; + *m() { return 42; } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..79abd2b1d7 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-alt.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + *m() { return 42; } + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..56d10480f4 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,101 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + *m() { return 42; } + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..8d3616dbbb --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,101 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; + *m() { return 42; } + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..a51d2a0a70 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + *m() { return 42; } + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-new-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-new-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..5c07c4cdb3 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-expr-new-sc-line-method.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +var C = class { + #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; + m() { return 42; } + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-new-sc-line-method-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..e643193c31 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-field-identifier-initializer.js @@ -0,0 +1,84 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-expr-new-sc-line-method.template +/*--- +description: Valid FieldDefinition (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; + m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-field-identifier.js b/test/language/expressions/class/fields-new-sc-line-method-rs-field-identifier.js new file mode 100644 index 0000000000..0bf202d1f4 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-field-identifier.js @@ -0,0 +1,91 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-expr-new-sc-line-method.template +/*--- +description: Valid FieldDefinition (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; + m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..068dc85b68 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier-alt.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-new-sc-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; + m() { return 42; } + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..d041281690 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-new-sc-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; + m() { return 42; } + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..a7b65c1618 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier-initializer.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-new-sc-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; + m() { return 42; } + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier.js b/test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier.js new file mode 100644 index 0000000000..3985fcc021 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-expr-new-sc-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; + m() { return 42; } + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-sc-line-method-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..d4806f6263 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,125 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-new-sc-line-method.template +/*--- +description: Valid Static Method PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; + m() { return 42; } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-new-sc-line-method-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..e1f09a5315 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-static-method-privatename-identifier.js @@ -0,0 +1,119 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-new-sc-line-method.template +/*--- +description: Valid Static Method PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; + m() { return 42; } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..3328f4b152 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-alt.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-new-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + m() { return 42; } + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..362b98deac --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,101 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-new-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + m() { return 42; } + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..ace5e03f92 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,101 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-new-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; + m() { return 42; } + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..cc7d1938eb --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-expr-new-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + m() { return 42; } + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-regular-definitions-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-regular-definitions-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..041cfcc2e5 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,94 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-expr-regular-definitions.template +/*--- +description: PrivateName Static Semantics, StringValue (regular fields defintion) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +var C = class { + #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/expressions/class/fields-regular-definitions-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-regular-definitions-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..1e0e3cdde1 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-rs-field-identifier-initializer.js @@ -0,0 +1,72 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-expr-regular-definitions.template +/*--- +description: Valid FieldDefinition (regular fields defintion) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1 + +} + +var c = new C(); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-regular-definitions-rs-field-identifier.js b/test/language/expressions/class/fields-regular-definitions-rs-field-identifier.js new file mode 100644 index 0000000000..ad9c241d8f --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-rs-field-identifier.js @@ -0,0 +1,79 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-expr-regular-definitions.template +/*--- +description: Valid FieldDefinition (regular fields defintion) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J + +} + +var c = new C(); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..b02fcda1cd --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier-alt.js @@ -0,0 +1,94 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-regular-definitions.template +/*--- +description: Valid PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..c73a77c87f --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,88 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-regular-definitions.template +/*--- +description: Valid PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1 + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..bf416c4434 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier-initializer.js @@ -0,0 +1,88 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-regular-definitions.template +/*--- +description: Valid PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1 + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier.js b/test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier.js new file mode 100644 index 0000000000..769990cab6 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier.js @@ -0,0 +1,94 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-expr-regular-definitions.template +/*--- +description: Valid PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-regular-definitions-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-regular-definitions-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..c80aa0fb19 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,113 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-regular-definitions.template +/*--- +description: Valid Static Method PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-regular-definitions-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-regular-definitions-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..e6081cec13 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-rs-static-method-privatename-identifier.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-regular-definitions.template +/*--- +description: Valid Static Method PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..2f02754482 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-alt.js @@ -0,0 +1,95 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-regular-definitions.template +/*--- +description: Valid Static PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..48835e88a7 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,89 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-regular-definitions.template +/*--- +description: Valid Static PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1 + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..bc7881bbd3 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,89 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-regular-definitions.template +/*--- +description: Valid Static PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1 + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..7d220b583c --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier.js @@ -0,0 +1,95 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-expr-regular-definitions.template +/*--- +description: Valid Static PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-same-line-async-gen-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-same-line-async-gen-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..beb3cc2488 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +var C = class { + async *m() { return 42; } #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-same-line-async-gen-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..bbdfedbb51 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-field-identifier-initializer.js @@ -0,0 +1,87 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Valid FieldDefinition (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + async *m() { return 42; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-field-identifier.js b/test/language/expressions/class/fields-same-line-async-gen-rs-field-identifier.js new file mode 100644 index 0000000000..beecac0890 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-field-identifier.js @@ -0,0 +1,94 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Valid FieldDefinition (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + async *m() { return 42; } $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..7735511177 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-alt.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Valid PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + async *m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..637644f0e4 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,103 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Valid PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + async *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..87052a49a2 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-initializer.js @@ -0,0 +1,103 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Valid PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + async *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier.js new file mode 100644 index 0000000000..087e6b602c --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Valid PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + async *m() { return 42; } #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..5863e85032 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,128 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Valid Static Method PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + async *m() { return 42; } static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..3f4c9d669c --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-method-privatename-identifier.js @@ -0,0 +1,122 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Valid Static Method PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + async *m() { return 42; } static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..56c4ad6330 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt.js @@ -0,0 +1,110 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + async *m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..7a69dae3c6 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,104 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + async *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..98f953fefc --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,104 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + async *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..eb6574f69c --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier.js @@ -0,0 +1,110 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + async *m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-same-line-async-method-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..47e9e32ab5 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,108 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +var C = class { + async m() { return 42; } #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-same-line-async-method-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..b68f5a4f9a --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-rs-field-identifier-initializer.js @@ -0,0 +1,86 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Valid FieldDefinition (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + async m() { return 42; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-field-identifier.js b/test/language/expressions/class/fields-same-line-async-method-rs-field-identifier.js new file mode 100644 index 0000000000..f326a177f7 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-rs-field-identifier.js @@ -0,0 +1,93 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Valid FieldDefinition (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + async m() { return 42; } $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..2a88cedd6c --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-alt.js @@ -0,0 +1,108 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Valid PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + async m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..999e3030b7 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,102 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Valid PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + async m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..44c1648c12 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-initializer.js @@ -0,0 +1,102 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Valid PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + async m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier.js new file mode 100644 index 0000000000..a8e9636aa6 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier.js @@ -0,0 +1,108 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Valid PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + async m() { return 42; } #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..c313384155 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,127 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Valid Static Method PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + async m() { return 42; } static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..68b413796a --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-method-privatename-identifier.js @@ -0,0 +1,121 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Valid Static Method PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + async m() { return 42; } static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..ee21047e7e --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-alt.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + async m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..29310bb8d5 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,103 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + async m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..6776f3be0e --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,103 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + async m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..290a73d447 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + async m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..3ba63e3ffc --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-expr-same-line-generator.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +var C = class { + #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; *m() { return 42; } + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/expressions/class/fields-same-line-gen-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-same-line-gen-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..df763485f5 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-rs-field-identifier-initializer.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-expr-same-line-generator.template +/*--- +description: Valid FieldDefinition (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; *m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-same-line-gen-rs-field-identifier.js b/test/language/expressions/class/fields-same-line-gen-rs-field-identifier.js new file mode 100644 index 0000000000..6e13fd26d8 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-rs-field-identifier.js @@ -0,0 +1,90 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-expr-same-line-generator.template +/*--- +description: Valid FieldDefinition (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; *m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..3d07448b0d --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier-alt.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-same-line-generator.template +/*--- +description: Valid PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; *m() { return 42; } + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..a74bc215f8 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-same-line-generator.template +/*--- +description: Valid PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; *m() { return 42; } + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..f663a4fff8 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier-initializer.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-same-line-generator.template +/*--- +description: Valid PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; *m() { return 42; } + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier.js b/test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier.js new file mode 100644 index 0000000000..307ad86868 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-expr-same-line-generator.template +/*--- +description: Valid PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; *m() { return 42; } + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-same-line-gen-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-gen-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..8626d4d9ce --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-same-line-generator.template +/*--- +description: Valid Static Method PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; *m() { return 42; } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-same-line-gen-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-gen-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..e75c4c43fb --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-rs-static-method-privatename-identifier.js @@ -0,0 +1,118 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-same-line-generator.template +/*--- +description: Valid Static Method PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; *m() { return 42; } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..3a46e362c5 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-alt.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-same-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; *m() { return 42; } + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..48dfcc5dc2 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-same-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; *m() { return 42; } + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..d9fd2bd514 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-same-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; *m() { return 42; } + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..95394cbfc4 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-expr-same-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; *m() { return 42; } + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..43d49b5254 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-expr-same-line-method.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +var C = class { + #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; m() { return 42; } + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/expressions/class/fields-same-line-method-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-same-line-method-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..d75572687c --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-rs-field-identifier-initializer.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-expr-same-line-method.template +/*--- +description: Valid FieldDefinition (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-same-line-method-rs-field-identifier.js b/test/language/expressions/class/fields-same-line-method-rs-field-identifier.js new file mode 100644 index 0000000000..52788e419e --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-rs-field-identifier.js @@ -0,0 +1,90 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-expr-same-line-method.template +/*--- +description: Valid FieldDefinition (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-same-line-method-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-method-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..6a65f2782d --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-rs-privatename-identifier-alt.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-same-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; m() { return 42; } + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/expressions/class/fields-same-line-method-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-same-line-method-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..2fcabecf4e --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-same-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; m() { return 42; } + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-same-line-method-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-same-line-method-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..0204afa5e6 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-rs-privatename-identifier-initializer.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-same-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; m() { return 42; } + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-same-line-method-rs-privatename-identifier.js b/test/language/expressions/class/fields-same-line-method-rs-privatename-identifier.js new file mode 100644 index 0000000000..b105329911 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-rs-privatename-identifier.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-expr-same-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; m() { return 42; } + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-same-line-method-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-method-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..3aad6acb36 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-same-line-method.template +/*--- +description: Valid Static Method PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; m() { return 42; } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-same-line-method-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-method-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..7079bb7a6f --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-rs-static-method-privatename-identifier.js @@ -0,0 +1,118 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-same-line-method.template +/*--- +description: Valid Static Method PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; m() { return 42; } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..e60739d025 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-alt.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; m() { return 42; } + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..4490b98386 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; m() { return 42; } + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..54220041d4 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; m() { return 42; } + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..cc08c93317 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-expr-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; m() { return 42; } + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-wrapped-in-sc-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-wrapped-in-sc-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..53c726d831 --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,96 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template +/*--- +description: PrivateName Static Semantics, StringValue (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +var C = class { + ;;;; + ;;;;;;#\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;;;;;;;; + ;;;; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..6a13112465 --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-field-identifier-initializer.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Valid FieldDefinition (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + ;;;; + ;;;;;;$ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1;;;;;;; + ;;;; + +} + +var c = new C(); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-field-identifier.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-field-identifier.js new file mode 100644 index 0000000000..77f2f760df --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-field-identifier.js @@ -0,0 +1,81 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Valid FieldDefinition (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + ;;;; + ;;;;;;$; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J;;;;;;; + ;;;; + +} + +var c = new C(); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..b7e59d2270 --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier-alt.js @@ -0,0 +1,96 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Valid PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + ;;;; + ;;;;;;#$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J;;;;;;; + ;;;; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..1590c6fbec --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,90 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Valid PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + ;;;; + ;;;;;;#$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1;;;;;;; + ;;;; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..4e9eb7d88d --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer.js @@ -0,0 +1,90 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Valid PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + ;;;; + ;;;;;;#$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1;;;;;;; + ;;;; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier.js new file mode 100644 index 0000000000..dc07187285 --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier.js @@ -0,0 +1,96 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Valid PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + ;;;; + ;;;;;;#$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J;;;;;;; + ;;;; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..d451faabf1 --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,115 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Valid Static Method PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + ;;;; + ;;;;;;static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + };;;;;;; + ;;;; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..718e57c760 --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Valid Static Method PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + ;;;; + ;;;;;;static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + };;;;;;; + ;;;; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..56476171f5 --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-alt.js @@ -0,0 +1,97 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Valid Static PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + ;;;; + ;;;;;;static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J;;;;;;; + ;;;; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..91f24eddda --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,91 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Valid Static PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + ;;;; + ;;;;;;static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1;;;;;;; + ;;;; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..600d128f4b --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,91 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Valid Static PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + ;;;; + ;;;;;;static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1;;;;;;; + ;;;; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..96d00ea178 --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier.js @@ -0,0 +1,97 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Valid Static PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + ;;;; + ;;;;;;static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J;;;;;;; + ;;;; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/syntax-error-grammar-field-def-has-initializer-no-sc.js b/test/language/expressions/class/syntax-error-grammar-field-def-has-initializer-no-sc.js new file mode 100644 index 0000000000..fbaef4ff02 --- /dev/null +++ b/test/language/expressions/class/syntax-error-grammar-field-def-has-initializer-no-sc.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-field-def-has-initializer-no-sc.case +// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template +/*--- +description: SyntaxError (class expression) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + x = [] +}; diff --git a/test/language/expressions/class/syntax-error-grammar-field-no-initializer-with-method.js b/test/language/expressions/class/syntax-error-grammar-field-no-initializer-with-method.js new file mode 100644 index 0000000000..8d5165aeea --- /dev/null +++ b/test/language/expressions/class/syntax-error-grammar-field-no-initializer-with-method.js @@ -0,0 +1,32 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-field-no-initializer-with-method.case +// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template +/*--- +description: SyntaxError (class expression) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + x + m() {} +}; diff --git a/test/language/expressions/class/syntax-error-grammar-fields.js b/test/language/expressions/class/syntax-error-grammar-fields.js new file mode 100644 index 0000000000..6407595550 --- /dev/null +++ b/test/language/expressions/class/syntax-error-grammar-fields.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-fields.case +// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template +/*--- +description: SyntaxError (class expression) +esid: prod-ClassElement +features: [class-fields-public, class] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + x y +}; diff --git a/test/language/expressions/class/syntax-error-grammar-privatename-no-initializer-with-method.js b/test/language/expressions/class/syntax-error-grammar-privatename-no-initializer-with-method.js new file mode 100644 index 0000000000..fd4b1769c8 --- /dev/null +++ b/test/language/expressions/class/syntax-error-grammar-privatename-no-initializer-with-method.js @@ -0,0 +1,35 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-no-initializer-with-method.case +// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template +/*--- +description: SyntaxError (class expression) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + #x + m() {} +}; diff --git a/test/language/expressions/class/syntax-error-grammar-privatename.js b/test/language/expressions/class/syntax-error-grammar-privatename.js new file mode 100644 index 0000000000..27af62cf40 --- /dev/null +++ b/test/language/expressions/class/syntax-error-grammar-privatename.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename.case +// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template +/*--- +description: SyntaxError (class expression) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + # x +}; diff --git a/test/language/expressions/class/syntax-error-grammar-privatenames.js b/test/language/expressions/class/syntax-error-grammar-privatenames.js new file mode 100644 index 0000000000..8ee4dfe277 --- /dev/null +++ b/test/language/expressions/class/syntax-error-grammar-privatenames.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatenames.case +// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template +/*--- +description: SyntaxError (class expression) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + #x #y +}; diff --git a/test/language/expressions/class/syntax-invalid-grammar-field-def-has-initializer-no-sc-error.js b/test/language/expressions/class/syntax-invalid-grammar-field-def-has-initializer-no-sc-error.js new file mode 100644 index 0000000000..bc825b5981 --- /dev/null +++ b/test/language/expressions/class/syntax-invalid-grammar-field-def-has-initializer-no-sc-error.js @@ -0,0 +1,35 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-field-def-has-initializer-no-sc-error.case +// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template +/*--- +description: SyntaxError (class expression) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + x = [] + y; +}; diff --git a/test/language/expressions/class/syntax-invalid-grammar-field-identifier-invalid-ues-error.js b/test/language/expressions/class/syntax-invalid-grammar-field-identifier-invalid-ues-error.js new file mode 100644 index 0000000000..e12ecfb47f --- /dev/null +++ b/test/language/expressions/class/syntax-invalid-grammar-field-identifier-invalid-ues-error.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-field-identifier-invalid-ues-error.case +// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template +/*--- +description: Valid FieldDefinition, ClassElementName, PropertyName Syntax (class expression) +esid: prod-ClassElement +features: [class-fields-public, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + StringLiteral + NumericLiteral + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart :: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart :: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue :: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + \u0000; +}; diff --git a/test/language/expressions/class/syntax-invalid-grammar-field-identifier-invalid-zwj-error.js b/test/language/expressions/class/syntax-invalid-grammar-field-identifier-invalid-zwj-error.js new file mode 100644 index 0000000000..9dd80bef4e --- /dev/null +++ b/test/language/expressions/class/syntax-invalid-grammar-field-identifier-invalid-zwj-error.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-field-identifier-invalid-zwj-error.case +// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template +/*--- +description: Valid FieldDefinition, ClassElementName, PropertyName Syntax (class expression) +esid: prod-ClassElement +features: [class-fields-public, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + StringLiteral + NumericLiteral + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart :: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart :: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue :: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + \u200D_ZWJ; +}; diff --git a/test/language/expressions/class/syntax-invalid-grammar-field-identifier-invalid-zwnj-error.js b/test/language/expressions/class/syntax-invalid-grammar-field-identifier-invalid-zwnj-error.js new file mode 100644 index 0000000000..efed7d1a68 --- /dev/null +++ b/test/language/expressions/class/syntax-invalid-grammar-field-identifier-invalid-zwnj-error.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-field-identifier-invalid-zwnj-error.case +// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template +/*--- +description: Valid FieldDefinition, ClassElementName, PropertyName Syntax (class expression) +esid: prod-ClassElement +features: [class-fields-public, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + StringLiteral + NumericLiteral + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart :: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart :: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue :: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + \u200C_ZWNJ; +}; diff --git a/test/language/expressions/class/syntax-invalid-grammar-fields-same-line-error.js b/test/language/expressions/class/syntax-invalid-grammar-fields-same-line-error.js new file mode 100644 index 0000000000..5b3a8bf5f9 --- /dev/null +++ b/test/language/expressions/class/syntax-invalid-grammar-fields-same-line-error.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-fields-same-line-error.case +// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template +/*--- +description: SyntaxError (class expression) +esid: prod-ClassElement +features: [class-fields-public, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + x y +}; diff --git a/test/language/expressions/class/syntax-invalid-grammar-privatename-error.js b/test/language/expressions/class/syntax-invalid-grammar-privatename-error.js new file mode 100644 index 0000000000..9fa2055c0d --- /dev/null +++ b/test/language/expressions/class/syntax-invalid-grammar-privatename-error.js @@ -0,0 +1,37 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-error.case +// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template +/*--- +description: SyntaxError (class expression) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + # x +}; diff --git a/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-invalid-ues.js b/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-invalid-ues.js new file mode 100644 index 0000000000..07c84a94b3 --- /dev/null +++ b/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-invalid-ues.js @@ -0,0 +1,65 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-invalid-ues.case +// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template +/*--- +description: Valid PrivateName Syntax (class expression) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + #\u0000; +}; diff --git a/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-invalid-zwj-error.js b/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-invalid-zwj-error.js new file mode 100644 index 0000000000..ff96485732 --- /dev/null +++ b/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-invalid-zwj-error.js @@ -0,0 +1,66 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-invalid-zwj-error.case +// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template +/*--- +description: Valid PrivateName Syntax (class expression) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + #\u200D_ZWJ; + +}; diff --git a/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-invalid-zwnj-error.js b/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-invalid-zwnj-error.js new file mode 100644 index 0000000000..4e5187f254 --- /dev/null +++ b/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-invalid-zwnj-error.js @@ -0,0 +1,66 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-invalid-zwnj-error.case +// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template +/*--- +description: Valid PrivateName Syntax (class expression) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + #\u200C_ZWNJ; + +}; diff --git a/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-non-id-start-error.js b/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-non-id-start-error.js new file mode 100644 index 0000000000..6628fbc8c5 --- /dev/null +++ b/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-non-id-start-error.js @@ -0,0 +1,65 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-non-id-start-error.case +// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template +/*--- +description: Valid PrivateName Syntax (class expression) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + #\u{00}; +}; diff --git a/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-non-ues-error.js b/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-non-ues-error.js new file mode 100644 index 0000000000..c652458c3c --- /dev/null +++ b/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-non-ues-error.js @@ -0,0 +1,65 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-non-ues-error.case +// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template +/*--- +description: Valid PrivateName Syntax (class expression) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + #\u0000; +}; diff --git a/test/language/expressions/class/syntax-invalid-grammar-privatenames-same-line-error.js b/test/language/expressions/class/syntax-invalid-grammar-privatenames-same-line-error.js new file mode 100644 index 0000000000..3c784f2c8a --- /dev/null +++ b/test/language/expressions/class/syntax-invalid-grammar-privatenames-same-line-error.js @@ -0,0 +1,37 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatenames-same-line-error.case +// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template +/*--- +description: SyntaxError (class expression) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + #x #y +}; diff --git a/test/language/expressions/class/syntax-valid-grammar-field-classelementname-initializer-alt.js b/test/language/expressions/class/syntax-valid-grammar-field-classelementname-initializer-alt.js new file mode 100644 index 0000000000..2208a98776 --- /dev/null +++ b/test/language/expressions/class/syntax-valid-grammar-field-classelementname-initializer-alt.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-field-classelementname-initializer-alt.case +// - src/class-fields/syntax/valid/cls-expr-fields-valid-syntax.template +/*--- +description: FieldDefinition, ClassElementName, PropertyName = Initializer Syntax (class expression) +esid: prod-ClassElement +features: [class-fields-public, class] +flags: [generated] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + Initializer : + = AssignmentExpression + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart :: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart :: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue :: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + $ = 1; + _ = 2; + \u{6F} = 3; + ℘ = 4; // DO NOT CHANGE THE NAME OF THIS FIELD + ZW_‌_NJ = 5; // DO NOT CHANGE THE NAME OF THIS FIELD + ZW_‍_J = 6; // DO NOT CHANGE THE NAME OF THIS FIELD +}; diff --git a/test/language/expressions/class/syntax-valid-grammar-field-classelementname-initializer.js b/test/language/expressions/class/syntax-valid-grammar-field-classelementname-initializer.js new file mode 100644 index 0000000000..9d5f47865f --- /dev/null +++ b/test/language/expressions/class/syntax-valid-grammar-field-classelementname-initializer.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-field-classelementname-initializer.case +// - src/class-fields/syntax/valid/cls-expr-fields-valid-syntax.template +/*--- +description: FieldDefinition, ClassElementName, PropertyName = Initializer Syntax (class expression) +esid: prod-ClassElement +features: [class-fields-public, class] +flags: [generated] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + Initializer : + = AssignmentExpression + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart :: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart :: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue :: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + $ = 1; + _ = 2; + \u{6F} = 3; + \u2118 = 4; + ZW_\u200C_NJ = 5; + ZW_\u200D_J = 6; +}; diff --git a/test/language/expressions/class/syntax-valid-grammar-field-identifier-alt.js b/test/language/expressions/class/syntax-valid-grammar-field-identifier-alt.js new file mode 100644 index 0000000000..66d2ac85ca --- /dev/null +++ b/test/language/expressions/class/syntax-valid-grammar-field-identifier-alt.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-field-identifier-alt.case +// - src/class-fields/syntax/valid/cls-expr-fields-valid-syntax.template +/*--- +description: Valid FieldDefinition, ClassElementName, PropertyName Syntax (class expression) +esid: prod-ClassElement +features: [class-fields-public, class] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + StringLiteral + NumericLiteral + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart :: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart :: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue :: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + $; + _; + \u{6F}; + ℘; // DO NOT CHANGE THE NAME OF THIS FIELD + ZW_‌_NJ; // DO NOT CHANGE THE NAME OF THIS FIELD + ZW_‍_J; // DO NOT CHANGE THE NAME OF THIS FIELD +}; diff --git a/test/language/expressions/class/syntax-valid-grammar-field-identifier.js b/test/language/expressions/class/syntax-valid-grammar-field-identifier.js new file mode 100644 index 0000000000..84e3d3babf --- /dev/null +++ b/test/language/expressions/class/syntax-valid-grammar-field-identifier.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-field-identifier.case +// - src/class-fields/syntax/valid/cls-expr-fields-valid-syntax.template +/*--- +description: Valid FieldDefinition, ClassElementName, PropertyName Syntax (class expression) +esid: prod-ClassElement +features: [class-fields-public, class] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + StringLiteral + NumericLiteral + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart :: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart :: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue :: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + $; + _; + \u{6F}; + \u2118; + ZW_\u200C_NJ; + ZW_\u200D_J; +}; diff --git a/test/language/expressions/class/syntax-valid-grammar-fields-multi-line.js b/test/language/expressions/class/syntax-valid-grammar-fields-multi-line.js new file mode 100644 index 0000000000..31c2a2636a --- /dev/null +++ b/test/language/expressions/class/syntax-valid-grammar-fields-multi-line.js @@ -0,0 +1,30 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-fields-multi-line.case +// - src/class-fields/syntax/valid/cls-expr-fields-valid-syntax.template +/*--- +description: SyntaxError (class expression) +esid: prod-ClassElement +features: [class-fields-public, class] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + +---*/ + + +var C = class { + x + y +}; diff --git a/test/language/expressions/class/syntax-valid-grammar-privatename-classelementname-initializer-alt.js b/test/language/expressions/class/syntax-valid-grammar-privatename-classelementname-initializer-alt.js new file mode 100644 index 0000000000..402984e744 --- /dev/null +++ b/test/language/expressions/class/syntax-valid-grammar-privatename-classelementname-initializer-alt.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-classelementname-initializer-alt.case +// - src/class-fields/syntax/valid/cls-expr-fields-valid-syntax.template +/*--- +description: Valid PrivateName = Initializer Syntax (class expression) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + Initializer : + = AssignmentExpression + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + #$ = 1; + #_ = 2; + #\u{6F} = 3; + #℘ = 4; // DO NOT CHANGE THE NAME OF THIS FIELD + #ZW_‌_NJ = 5; // DO NOT CHANGE THE NAME OF THIS FIELD + #ZW_‍_J = 6; // DO NOT CHANGE THE NAME OF THIS FIELD +}; diff --git a/test/language/expressions/class/syntax-valid-grammar-privatename-classelementname-initializer.js b/test/language/expressions/class/syntax-valid-grammar-privatename-classelementname-initializer.js new file mode 100644 index 0000000000..2300ceb9bb --- /dev/null +++ b/test/language/expressions/class/syntax-valid-grammar-privatename-classelementname-initializer.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-classelementname-initializer.case +// - src/class-fields/syntax/valid/cls-expr-fields-valid-syntax.template +/*--- +description: Valid PrivateName = Initializer Syntax (class expression) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + Initializer : + = AssignmentExpression + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + #$ = 1; + #_ = 2; + #\u{6F} = 3; + #\u2118 = 4; + #ZW_\u200C_NJ = 5; + #ZW_\u200D_J = 6; +}; diff --git a/test/language/expressions/class/syntax-valid-grammar-privatename-identifier.js b/test/language/expressions/class/syntax-valid-grammar-privatename-identifier.js new file mode 100644 index 0000000000..3dd423e459 --- /dev/null +++ b/test/language/expressions/class/syntax-valid-grammar-privatename-identifier.js @@ -0,0 +1,65 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier.case +// - src/class-fields/syntax/valid/cls-expr-fields-valid-syntax.template +/*--- +description: Valid PrivateName Syntax (class expression) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +var C = class { + #$; + #_; + #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J; +}; diff --git a/test/language/expressions/class/syntax-valid-grammar-privatename-no-initializer-with-method.js b/test/language/expressions/class/syntax-valid-grammar-privatename-no-initializer-with-method.js new file mode 100644 index 0000000000..59c168d547 --- /dev/null +++ b/test/language/expressions/class/syntax-valid-grammar-privatename-no-initializer-with-method.js @@ -0,0 +1,33 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-no-initializer-with-method.case +// - src/class-fields/syntax/valid/cls-expr-fields-valid-syntax.template +/*--- +description: SyntaxError (class expression) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + +---*/ + + +var C = class { + #x + m() {} +}; diff --git a/test/language/expressions/class/syntax-valid-grammar-privatenames-multi-line.js b/test/language/expressions/class/syntax-valid-grammar-privatenames-multi-line.js new file mode 100644 index 0000000000..12c752cead --- /dev/null +++ b/test/language/expressions/class/syntax-valid-grammar-privatenames-multi-line.js @@ -0,0 +1,33 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatenames-multi-line.case +// - src/class-fields/syntax/valid/cls-expr-fields-valid-syntax.template +/*--- +description: SyntaxError (class expression) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + +---*/ + + +var C = class { + #x + #y +}; diff --git a/test/language/statements/class/fields-after-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-after-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..f0d5d3d869 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-decl-after-same-line-gen.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +class C { + *m() { return 42; } #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-field-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-gen-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..bb5b0c29cb --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-rs-field-identifier-initializer.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-gen.template +/*--- +description: Valid FieldDefinition (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + *m() { return 42; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-field-identifier.js b/test/language/statements/class/fields-after-same-line-gen-rs-field-identifier.js new file mode 100644 index 0000000000..8ad3b28987 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-rs-field-identifier.js @@ -0,0 +1,90 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-gen.template +/*--- +description: Valid FieldDefinition (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + *m() { return 42; } $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..d3ff9843a6 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier-alt.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-gen.template +/*--- +description: Valid PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + *m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..57020b3038 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-gen.template +/*--- +description: Valid PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..3ed96ba41e --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier-initializer.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-gen.template +/*--- +description: Valid PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier.js new file mode 100644 index 0000000000..21c2743ab5 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-gen.template +/*--- +description: Valid PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + *m() { return 42; } #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-gen-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..9d7602d88a --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-gen.template +/*--- +description: Valid Static Method PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + *m() { return 42; } static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-gen-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..10801eb81d --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-rs-static-method-privatename-identifier.js @@ -0,0 +1,118 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-gen.template +/*--- +description: Valid Static Method PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + *m() { return 42; } static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..77b9bc9dc6 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-alt.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + *m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..31184005f2 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..879397ec08 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..68718363b5 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + *m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-after-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-after-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..61b6da15b2 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-decl-after-same-line-method.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +class C { + m() { return 42; } #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/statements/class/fields-after-same-line-method-rs-field-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-method-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..fb52206576 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-rs-field-identifier-initializer.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-method.template +/*--- +description: Valid FieldDefinition (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + m() { return 42; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-after-same-line-method-rs-field-identifier.js b/test/language/statements/class/fields-after-same-line-method-rs-field-identifier.js new file mode 100644 index 0000000000..baad9d3789 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-rs-field-identifier.js @@ -0,0 +1,90 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-method.template +/*--- +description: Valid FieldDefinition (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + m() { return 42; } $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..0df46fd173 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier-alt.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-method.template +/*--- +description: Valid PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..0ec2d10a1a --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-method.template +/*--- +description: Valid PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..ca70313036 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier-initializer.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-method.template +/*--- +description: Valid PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier.js new file mode 100644 index 0000000000..e5a1a42578 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-method.template +/*--- +description: Valid PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + m() { return 42; } #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-after-same-line-method-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-method-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..9307410f92 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-method.template +/*--- +description: Valid Static Method PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + m() { return 42; } static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-after-same-line-method-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-method-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..c8674d0806 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-rs-static-method-privatename-identifier.js @@ -0,0 +1,118 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-method.template +/*--- +description: Valid Static Method PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + m() { return 42; } static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..5966b9f911 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-alt.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..1a79b9f781 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..0effbde88b --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..225353687c --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-after-same-line-static-async-gen-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..00a11b1b80 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +class C { + static async *m() { return 42; } #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-field-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..31e9d4bd02 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-field-identifier-initializer.js @@ -0,0 +1,87 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Valid FieldDefinition (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static async *m() { return 42; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-field-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-field-identifier.js new file mode 100644 index 0000000000..37a91f8367 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-field-identifier.js @@ -0,0 +1,94 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Valid FieldDefinition (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static async *m() { return 42; } $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..2e3f7e474d --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-alt.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Valid PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static async *m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..71ba207ac6 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,103 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Valid PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static async *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..cb27bfb4e8 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer.js @@ -0,0 +1,103 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Valid PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static async *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier.js new file mode 100644 index 0000000000..88e75b193c --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Valid PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static async *m() { return 42; } #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..1dbf9e7330 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,128 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Valid Static Method PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static async *m() { return 42; } static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..8cc3b1eaf3 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier.js @@ -0,0 +1,122 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Valid Static Method PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static async *m() { return 42; } static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..3d53db9e2b --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt.js @@ -0,0 +1,110 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static async *m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..dc2457f1b4 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,104 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static async *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..6e0bd25a22 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,104 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static async *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..e154ad948d --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier.js @@ -0,0 +1,110 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static async *m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-after-same-line-static-async-method-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..af52cae65b --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,108 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +class C { + static async m() { return 42; } #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-field-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..9cd2102348 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-field-identifier-initializer.js @@ -0,0 +1,86 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Valid FieldDefinition (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static async m() { return 42; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-field-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-field-identifier.js new file mode 100644 index 0000000000..f265b554a1 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-field-identifier.js @@ -0,0 +1,93 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Valid FieldDefinition (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static async m() { return 42; } $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..2c1614bf00 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-alt.js @@ -0,0 +1,108 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Valid PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static async m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..e77d1ee1d6 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,102 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Valid PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static async m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..615777f71f --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer.js @@ -0,0 +1,102 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Valid PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static async m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier.js new file mode 100644 index 0000000000..6dd90ca9d8 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier.js @@ -0,0 +1,108 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Valid PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static async m() { return 42; } #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..a90f56c3fe --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,127 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Valid Static Method PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static async m() { return 42; } static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..e3ae14e8dc --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier.js @@ -0,0 +1,121 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Valid Static Method PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static async m() { return 42; } static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..79460938b7 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static async m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..a3a825ad92 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,103 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static async m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..bf5c8cc24f --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,103 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static async m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..a38f6c4d74 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static async m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-gen-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-after-same-line-static-gen-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..0991ff9354 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +class C { + static *m() { return 42; } #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-field-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..5d3c96d910 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-field-identifier-initializer.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Valid FieldDefinition (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static *m() { return 42; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; + +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-field-identifier.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-field-identifier.js new file mode 100644 index 0000000000..30d0d1e4e9 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-field-identifier.js @@ -0,0 +1,90 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Valid FieldDefinition (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static *m() { return 42; } $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; + +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..30ccd4f707 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier-alt.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Valid PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static *m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..a924e0a11f --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Valid PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..f8a948131c --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Valid PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier.js new file mode 100644 index 0000000000..682f1fdabc --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Valid PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static *m() { return 42; } #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..910ec2e31c --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Valid Static Method PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static *m() { return 42; } static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..8df748077f --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier.js @@ -0,0 +1,118 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Valid Static Method PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static *m() { return 42; } static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..8eba30baf7 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-alt.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static *m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..aa4abf04b3 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..2e0cbb484c --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..9ee640049e --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static *m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-after-same-line-static-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-after-same-line-static-method-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..82393b1bfe --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +class C { + static m() { return 42; } #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-field-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-method-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..24fb8b5632 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-field-identifier-initializer.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Valid FieldDefinition (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static m() { return 42; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; + +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-field-identifier.js b/test/language/statements/class/fields-after-same-line-static-method-rs-field-identifier.js new file mode 100644 index 0000000000..cff5a7f9c9 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-field-identifier.js @@ -0,0 +1,90 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Valid FieldDefinition (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static m() { return 42; } $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; + +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..afe1dcac02 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier-alt.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Valid PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..047f50e714 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Valid PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..73abdab8c2 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Valid PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier.js new file mode 100644 index 0000000000..d736747c32 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Valid PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static m() { return 42; } #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..35b58661cf --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Valid Static Method PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static m() { return 42; } static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..4d9376e51b --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier.js @@ -0,0 +1,118 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Valid Static Method PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static m() { return 42; } static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..a4df060683 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-alt.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..75fffcc2fd --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..222e3c3d0c --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..59fd93d265 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-multiple-definitions-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-multiple-definitions-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..e749c637b5 --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,141 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-decl-multiple-definitions.template +/*--- +description: PrivateName Static Semantics, StringValue (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +class C { + foo = "foobar"; + m() { return 42 } + #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J; + m2() { return 39 } + bar = "barbaz"; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/statements/class/fields-multiple-definitions-rs-field-identifier-initializer.js b/test/language/statements/class/fields-multiple-definitions-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..687a0e89b5 --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-rs-field-identifier-initializer.js @@ -0,0 +1,119 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-decl-multiple-definitions.template +/*--- +description: Valid FieldDefinition (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + foo = "foobar"; + m() { return 42 } + $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1 + m2() { return 39 } + bar = "barbaz"; + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-multiple-definitions-rs-field-identifier.js b/test/language/statements/class/fields-multiple-definitions-rs-field-identifier.js new file mode 100644 index 0000000000..90f5beeac8 --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-rs-field-identifier.js @@ -0,0 +1,126 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-decl-multiple-definitions.template +/*--- +description: Valid FieldDefinition (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + foo = "foobar"; + m() { return 42 } + $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J + m2() { return 39 } + bar = "barbaz"; + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..2ff87867ef --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier-alt.js @@ -0,0 +1,141 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-multiple-definitions.template +/*--- +description: Valid PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + foo = "foobar"; + m() { return 42 } + #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J + m2() { return 39 } + bar = "barbaz"; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..6f79a3983d --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,135 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-multiple-definitions.template +/*--- +description: Valid PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + foo = "foobar"; + m() { return 42 } + #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1 + m2() { return 39 } + bar = "barbaz"; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..2d0407dcc9 --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier-initializer.js @@ -0,0 +1,135 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-multiple-definitions.template +/*--- +description: Valid PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + foo = "foobar"; + m() { return 42 } + #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1 + m2() { return 39 } + bar = "barbaz"; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier.js b/test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier.js new file mode 100644 index 0000000000..83e1449291 --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier.js @@ -0,0 +1,141 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-decl-multiple-definitions.template +/*--- +description: Valid PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + foo = "foobar"; + m() { return 42 } + #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J + m2() { return 39 } + bar = "barbaz"; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-multiple-definitions-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-multiple-definitions-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..bcfb8748ea --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,160 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-multiple-definitions.template +/*--- +description: Valid Static Method PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + foo = "foobar"; + m() { return 42 } + static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + } + m2() { return 39 } + bar = "barbaz"; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-multiple-definitions-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-multiple-definitions-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..09478b3851 --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-rs-static-method-privatename-identifier.js @@ -0,0 +1,154 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-multiple-definitions.template +/*--- +description: Valid Static Method PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + foo = "foobar"; + m() { return 42 } + static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + } + m2() { return 39 } + bar = "barbaz"; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..dfdd73f063 --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-alt.js @@ -0,0 +1,142 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-multiple-definitions.template +/*--- +description: Valid Static PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + foo = "foobar"; + m() { return 42 } + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J + m2() { return 39 } + bar = "barbaz"; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..bca1831262 --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,136 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-multiple-definitions.template +/*--- +description: Valid Static PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + foo = "foobar"; + m() { return 42 } + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1 + m2() { return 39 } + bar = "barbaz"; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..c21ea4bfe3 --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,136 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-multiple-definitions.template +/*--- +description: Valid Static PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + foo = "foobar"; + m() { return 42 } + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1 + m2() { return 39 } + bar = "barbaz"; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier.js b/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..00fd6c1921 --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier.js @@ -0,0 +1,142 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-decl-multiple-definitions.template +/*--- +description: Valid Static PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + foo = "foobar"; + m() { return 42 } + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J + m2() { return 39 } + bar = "barbaz"; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-multiple-stacked-definitions-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..22fa2b0da1 --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,119 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: PrivateName Static Semantics, StringValue (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +class C { + #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J; + foo = "foobar" + bar = "barbaz"; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-field-identifier-initializer.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..76c04b7d49 --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-field-identifier-initializer.js @@ -0,0 +1,97 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Valid FieldDefinition (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1 + foo = "foobar" + bar = "barbaz"; + +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-field-identifier.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-field-identifier.js new file mode 100644 index 0000000000..e247070e43 --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-field-identifier.js @@ -0,0 +1,104 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Valid FieldDefinition (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J + foo = "foobar" + bar = "barbaz"; + +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..aa000ad656 --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier-alt.js @@ -0,0 +1,119 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Valid PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J + foo = "foobar" + bar = "barbaz"; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..ab1bb85ab4 --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,113 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Valid PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1 + foo = "foobar" + bar = "barbaz"; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..bae395d9ac --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer.js @@ -0,0 +1,113 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Valid PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1 + foo = "foobar" + bar = "barbaz"; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier.js new file mode 100644 index 0000000000..272bc0f863 --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier.js @@ -0,0 +1,119 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Valid PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J + foo = "foobar" + bar = "barbaz"; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..ef23039467 --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,138 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Valid Static Method PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + } + foo = "foobar" + bar = "barbaz"; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..93d348a85a --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier.js @@ -0,0 +1,132 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Valid Static Method PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + } + foo = "foobar" + bar = "barbaz"; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..9342cb0df3 --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-alt.js @@ -0,0 +1,120 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Valid Static PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J + foo = "foobar" + bar = "barbaz"; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..13c7d5b6ad --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,114 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Valid Static PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1 + foo = "foobar" + bar = "barbaz"; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..298fcd3813 --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,114 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Valid Static PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1 + foo = "foobar" + bar = "barbaz"; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..216abbc8b8 --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier.js @@ -0,0 +1,120 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Valid Static PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J + foo = "foobar" + bar = "barbaz"; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-new-no-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-new-no-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..9c0ac0843a --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +class C { + #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J; + m() { return 42; } + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-field-identifier-initializer.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..360326b4af --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-field-identifier-initializer.js @@ -0,0 +1,84 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Valid FieldDefinition (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1 + m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-field-identifier.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-field-identifier.js new file mode 100644 index 0000000000..119e961590 --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-field-identifier.js @@ -0,0 +1,91 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Valid FieldDefinition (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J + m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..7d2e2a20ab --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier-alt.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J + m() { return 42; } + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..5f3108daea --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1 + m() { return 42; } + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..b379b24f68 --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1 + m() { return 42; } + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier.js new file mode 100644 index 0000000000..bd161b009e --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J + m() { return 42; } + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..def9522ced --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,125 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Valid Static Method PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + } + m() { return 42; } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..bf2d74877f --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier.js @@ -0,0 +1,119 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Valid Static Method PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + } + m() { return 42; } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..ef29d93d2f --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-alt.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J + m() { return 42; } + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..5dffc941b5 --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,101 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1 + m() { return 42; } + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..d0d2db69d9 --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,101 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1 + m() { return 42; } + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..002c1424d0 --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J + m() { return 42; } + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-new-sc-line-gen-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-new-sc-line-gen-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..98b45a5a8f --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +class C { + #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; + *m() { return 42; } + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-field-identifier-initializer.js b/test/language/statements/class/fields-new-sc-line-gen-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..467ee066d3 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-field-identifier-initializer.js @@ -0,0 +1,84 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Valid FieldDefinition (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; + *m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-field-identifier.js b/test/language/statements/class/fields-new-sc-line-gen-rs-field-identifier.js new file mode 100644 index 0000000000..e61355b381 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-field-identifier.js @@ -0,0 +1,91 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Valid FieldDefinition (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; + *m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..b5a7337abc --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier-alt.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; + *m() { return 42; } + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..a2302883ff --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; + *m() { return 42; } + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..c5841d293e --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; + *m() { return 42; } + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier.js b/test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier.js new file mode 100644 index 0000000000..07e31b0595 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; + *m() { return 42; } + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..09243ce857 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,125 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Valid Static Method PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; + *m() { return 42; } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..037f0af699 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier.js @@ -0,0 +1,119 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Valid Static Method PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; + *m() { return 42; } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..de4903af25 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-alt.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + *m() { return 42; } + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..022c50d953 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,101 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + *m() { return 42; } + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..a0d77cef6b --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,101 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; + *m() { return 42; } + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier.js b/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..2082647210 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + *m() { return 42; } + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-new-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-new-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..619efe11e3 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-decl-new-sc-line-method.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +class C { + #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; + m() { return 42; } + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-field-identifier-initializer.js b/test/language/statements/class/fields-new-sc-line-method-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..2b98490a54 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-rs-field-identifier-initializer.js @@ -0,0 +1,84 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-decl-new-sc-line-method.template +/*--- +description: Valid FieldDefinition (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; + m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-field-identifier.js b/test/language/statements/class/fields-new-sc-line-method-rs-field-identifier.js new file mode 100644 index 0000000000..77075206b3 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-rs-field-identifier.js @@ -0,0 +1,91 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-decl-new-sc-line-method.template +/*--- +description: Valid FieldDefinition (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; + m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..781cc7baa0 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier-alt.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-new-sc-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; + m() { return 42; } + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..a68c9c672b --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-new-sc-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; + m() { return 42; } + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..0be603cf23 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier-initializer.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-new-sc-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; + m() { return 42; } + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier.js b/test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier.js new file mode 100644 index 0000000000..77965045d0 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-decl-new-sc-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; + m() { return 42; } + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-new-sc-line-method-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..aef53585d1 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,125 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-new-sc-line-method.template +/*--- +description: Valid Static Method PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; + m() { return 42; } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-new-sc-line-method-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..d5b6f83f37 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-rs-static-method-privatename-identifier.js @@ -0,0 +1,119 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-new-sc-line-method.template +/*--- +description: Valid Static Method PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; + m() { return 42; } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..a220ddb736 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-alt.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-new-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + m() { return 42; } + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..32f572cf7e --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,101 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-new-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + m() { return 42; } + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..ddfc226c3c --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,101 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-new-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; + m() { return 42; } + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier.js b/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..e6d17b1502 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-decl-new-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + m() { return 42; } + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-regular-definitions-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-regular-definitions-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..3b6200a167 --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,94 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-decl-regular-definitions.template +/*--- +description: PrivateName Static Semantics, StringValue (regular fields defintion) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +class C { + #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/statements/class/fields-regular-definitions-rs-field-identifier-initializer.js b/test/language/statements/class/fields-regular-definitions-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..6439266ac6 --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-rs-field-identifier-initializer.js @@ -0,0 +1,72 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-decl-regular-definitions.template +/*--- +description: Valid FieldDefinition (regular fields defintion) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1 + +} + +var c = new C(); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-regular-definitions-rs-field-identifier.js b/test/language/statements/class/fields-regular-definitions-rs-field-identifier.js new file mode 100644 index 0000000000..719660f778 --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-rs-field-identifier.js @@ -0,0 +1,79 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-decl-regular-definitions.template +/*--- +description: Valid FieldDefinition (regular fields defintion) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J + +} + +var c = new C(); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-regular-definitions-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-regular-definitions-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..8d063826b9 --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-rs-privatename-identifier-alt.js @@ -0,0 +1,94 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-regular-definitions.template +/*--- +description: Valid PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/statements/class/fields-regular-definitions-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-regular-definitions-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..9e7e93dc4a --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,88 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-regular-definitions.template +/*--- +description: Valid PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1 + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-regular-definitions-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-regular-definitions-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..b943795c9e --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-rs-privatename-identifier-initializer.js @@ -0,0 +1,88 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-regular-definitions.template +/*--- +description: Valid PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1 + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-regular-definitions-rs-privatename-identifier.js b/test/language/statements/class/fields-regular-definitions-rs-privatename-identifier.js new file mode 100644 index 0000000000..0f123c614f --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-rs-privatename-identifier.js @@ -0,0 +1,94 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-decl-regular-definitions.template +/*--- +description: Valid PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-regular-definitions-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-regular-definitions-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..f32831af59 --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,113 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-regular-definitions.template +/*--- +description: Valid Static Method PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-regular-definitions-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-regular-definitions-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..f825b5cd62 --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-rs-static-method-privatename-identifier.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-regular-definitions.template +/*--- +description: Valid Static Method PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..a0834c7e2c --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-alt.js @@ -0,0 +1,95 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-regular-definitions.template +/*--- +description: Valid Static PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..d53d2260f5 --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,89 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-regular-definitions.template +/*--- +description: Valid Static PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1 + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..169139c146 --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,89 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-regular-definitions.template +/*--- +description: Valid Static PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1 + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier.js b/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..9fe26d29d5 --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier.js @@ -0,0 +1,95 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-decl-regular-definitions.template +/*--- +description: Valid Static PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-same-line-async-gen-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-same-line-async-gen-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..684c6cde62 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +class C { + async *m() { return 42; } #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-field-identifier-initializer.js b/test/language/statements/class/fields-same-line-async-gen-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..96d9b0a9cd --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-rs-field-identifier-initializer.js @@ -0,0 +1,87 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Valid FieldDefinition (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + async *m() { return 42; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-field-identifier.js b/test/language/statements/class/fields-same-line-async-gen-rs-field-identifier.js new file mode 100644 index 0000000000..45fb9c76a7 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-rs-field-identifier.js @@ -0,0 +1,94 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Valid FieldDefinition (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + async *m() { return 42; } $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..01b1b15be3 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-alt.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Valid PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + async *m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..1d3fef8e89 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,103 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Valid PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + async *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..fe793e6a42 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-initializer.js @@ -0,0 +1,103 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Valid PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + async *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier.js new file mode 100644 index 0000000000..01b1418205 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Valid PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + async *m() { return 42; } #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..95282d0a0f --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,128 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Valid Static Method PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + async *m() { return 42; } static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..63d11f1ee3 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-method-privatename-identifier.js @@ -0,0 +1,122 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Valid Static Method PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + async *m() { return 42; } static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..6649adc942 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt.js @@ -0,0 +1,110 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + async *m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..38a850f4ad --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,104 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + async *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..15731e6585 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,104 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + async *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..4ee4955df7 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier.js @@ -0,0 +1,110 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + async *m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-same-line-async-method-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..1ee7dd8fd3 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,108 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +class C { + async m() { return 42; } #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-field-identifier-initializer.js b/test/language/statements/class/fields-same-line-async-method-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..292a5c4b39 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-rs-field-identifier-initializer.js @@ -0,0 +1,86 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Valid FieldDefinition (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + async m() { return 42; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-field-identifier.js b/test/language/statements/class/fields-same-line-async-method-rs-field-identifier.js new file mode 100644 index 0000000000..fd0af86be3 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-rs-field-identifier.js @@ -0,0 +1,93 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Valid FieldDefinition (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + async m() { return 42; } $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..88897a8a75 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-alt.js @@ -0,0 +1,108 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Valid PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + async m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..bc7ec4d60f --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,102 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Valid PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + async m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..d695c6068d --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-initializer.js @@ -0,0 +1,102 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Valid PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + async m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier.js new file mode 100644 index 0000000000..d4c78171b2 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier.js @@ -0,0 +1,108 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Valid PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + async m() { return 42; } #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-async-method-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..1e8d884956 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,127 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Valid Static Method PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + async m() { return 42; } static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-method-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..4689824b50 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-method-privatename-identifier.js @@ -0,0 +1,121 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Valid Static Method PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + async m() { return 42; } static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..874375753a --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-alt.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + async m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..a6a4e362c6 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,103 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + async m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..fb5b87f15c --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,103 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + async m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..723f1ab635 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + async m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..8a26a88ca0 --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-decl-same-line-generator.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +class C { + #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; *m() { return 42; } + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/statements/class/fields-same-line-gen-rs-field-identifier-initializer.js b/test/language/statements/class/fields-same-line-gen-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..730cf1ab8f --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-rs-field-identifier-initializer.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-decl-same-line-generator.template +/*--- +description: Valid FieldDefinition (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; *m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-same-line-gen-rs-field-identifier.js b/test/language/statements/class/fields-same-line-gen-rs-field-identifier.js new file mode 100644 index 0000000000..bbb8c36526 --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-rs-field-identifier.js @@ -0,0 +1,90 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-decl-same-line-generator.template +/*--- +description: Valid FieldDefinition (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; *m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-same-line-gen-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-gen-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..5f6cdf2a78 --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-rs-privatename-identifier-alt.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-same-line-generator.template +/*--- +description: Valid PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; *m() { return 42; } + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/statements/class/fields-same-line-gen-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-same-line-gen-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..ca55902848 --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-same-line-generator.template +/*--- +description: Valid PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; *m() { return 42; } + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-same-line-gen-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-same-line-gen-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..eb13a59e9a --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-rs-privatename-identifier-initializer.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-same-line-generator.template +/*--- +description: Valid PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; *m() { return 42; } + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-same-line-gen-rs-privatename-identifier.js b/test/language/statements/class/fields-same-line-gen-rs-privatename-identifier.js new file mode 100644 index 0000000000..ebf2311b1c --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-rs-privatename-identifier.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-decl-same-line-generator.template +/*--- +description: Valid PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; *m() { return 42; } + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-same-line-gen-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-gen-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..16754b1bab --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-same-line-generator.template +/*--- +description: Valid Static Method PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; *m() { return 42; } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-same-line-gen-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-gen-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..aef62fd988 --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-rs-static-method-privatename-identifier.js @@ -0,0 +1,118 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-same-line-generator.template +/*--- +description: Valid Static Method PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; *m() { return 42; } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..3180736ccc --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-alt.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-same-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; *m() { return 42; } + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..ef96d042d7 --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-same-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; *m() { return 42; } + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..460d9d2caf --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-same-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; *m() { return 42; } + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier.js b/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..a217c90f53 --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-decl-same-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; *m() { return 42; } + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..2d4adbcbf6 --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-decl-same-line-method.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +class C { + #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; m() { return 42; } + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/statements/class/fields-same-line-method-rs-field-identifier-initializer.js b/test/language/statements/class/fields-same-line-method-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..6da87a0772 --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-rs-field-identifier-initializer.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-decl-same-line-method.template +/*--- +description: Valid FieldDefinition (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-same-line-method-rs-field-identifier.js b/test/language/statements/class/fields-same-line-method-rs-field-identifier.js new file mode 100644 index 0000000000..532cf1574d --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-rs-field-identifier.js @@ -0,0 +1,90 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-decl-same-line-method.template +/*--- +description: Valid FieldDefinition (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-same-line-method-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-method-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..5b8e75fe25 --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-rs-privatename-identifier-alt.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-same-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; m() { return 42; } + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/statements/class/fields-same-line-method-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-same-line-method-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..d5cab7a721 --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-same-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; m() { return 42; } + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-same-line-method-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-same-line-method-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..99a60d4a1d --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-rs-privatename-identifier-initializer.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-same-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; m() { return 42; } + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-same-line-method-rs-privatename-identifier.js b/test/language/statements/class/fields-same-line-method-rs-privatename-identifier.js new file mode 100644 index 0000000000..0476a72839 --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-rs-privatename-identifier.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-decl-same-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; m() { return 42; } + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-same-line-method-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-method-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..da60f6ade0 --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-same-line-method.template +/*--- +description: Valid Static Method PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; m() { return 42; } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-same-line-method-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-method-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..2a8e5726c2 --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-rs-static-method-privatename-identifier.js @@ -0,0 +1,118 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-same-line-method.template +/*--- +description: Valid Static Method PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; m() { return 42; } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..c50fc6c5c7 --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-alt.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; m() { return 42; } + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..c840d5639d --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; m() { return 42; } + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..5bdd621782 --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; m() { return 42; } + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier.js b/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..27d499712f --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-decl-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; m() { return 42; } + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-wrapped-in-sc-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-wrapped-in-sc-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..b4b458afbb --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,96 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template +/*--- +description: PrivateName Static Semantics, StringValue (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +class C { + ;;;; + ;;;;;;#\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;;;;;;;; + ;;;; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-field-identifier-initializer.js b/test/language/statements/class/fields-wrapped-in-sc-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..0b36001dc4 --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-field-identifier-initializer.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Valid FieldDefinition (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + ;;;; + ;;;;;;$ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1;;;;;;; + ;;;; + +} + +var c = new C(); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-field-identifier.js b/test/language/statements/class/fields-wrapped-in-sc-rs-field-identifier.js new file mode 100644 index 0000000000..9ed86d6da1 --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-field-identifier.js @@ -0,0 +1,81 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Valid FieldDefinition (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + ;;;; + ;;;;;;$; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J;;;;;;; + ;;;; + +} + +var c = new C(); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..c0d6bb22dd --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier-alt.js @@ -0,0 +1,96 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Valid PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + ;;;; + ;;;;;;#$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J;;;;;;; + ;;;; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..63f406d8f5 --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,90 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Valid PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + ;;;; + ;;;;;;#$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1;;;;;;; + ;;;; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..6803fd8731 --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer.js @@ -0,0 +1,90 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Valid PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + ;;;; + ;;;;;;#$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1;;;;;;; + ;;;; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier.js b/test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier.js new file mode 100644 index 0000000000..d6d84e59db --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier.js @@ -0,0 +1,96 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Valid PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + ;;;; + ;;;;;;#$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J;;;;;;; + ;;;; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..16561b43e5 --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,115 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Valid Static Method PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + ;;;; + ;;;;;;static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + };;;;;;; + ;;;; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..8801041a42 --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Valid Static Method PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + ;;;; + ;;;;;;static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + };;;;;;; + ;;;; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..b17e1c0926 --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-alt.js @@ -0,0 +1,97 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Valid Static PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + ;;;; + ;;;;;;static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J;;;;;;; + ;;;; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..a680c61c5c --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,91 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Valid Static PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + ;;;; + ;;;;;;static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1;;;;;;; + ;;;; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..93b92daff4 --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,91 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Valid Static PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + ;;;; + ;;;;;;static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1;;;;;;; + ;;;; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier.js b/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..4725ed7115 --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier.js @@ -0,0 +1,97 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Valid Static PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + ;;;; + ;;;;;;static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J;;;;;;; + ;;;; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/syntax-error-grammar-field-def-has-initializer-no-sc.js b/test/language/statements/class/syntax-error-grammar-field-def-has-initializer-no-sc.js new file mode 100644 index 0000000000..4dfed1839e --- /dev/null +++ b/test/language/statements/class/syntax-error-grammar-field-def-has-initializer-no-sc.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-field-def-has-initializer-no-sc.case +// - src/class-fields/syntax/invalid/cls-decl-fields-invalid-syntax.template +/*--- +description: SyntaxError (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + x = [] +} diff --git a/test/language/statements/class/syntax-error-grammar-field-no-initializer-with-method.js b/test/language/statements/class/syntax-error-grammar-field-no-initializer-with-method.js new file mode 100644 index 0000000000..d4991c69f1 --- /dev/null +++ b/test/language/statements/class/syntax-error-grammar-field-no-initializer-with-method.js @@ -0,0 +1,32 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-field-no-initializer-with-method.case +// - src/class-fields/syntax/invalid/cls-decl-fields-invalid-syntax.template +/*--- +description: SyntaxError (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + x + m() {} +} diff --git a/test/language/statements/class/syntax-error-grammar-fields.js b/test/language/statements/class/syntax-error-grammar-fields.js new file mode 100644 index 0000000000..7b0527c42f --- /dev/null +++ b/test/language/statements/class/syntax-error-grammar-fields.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-fields.case +// - src/class-fields/syntax/invalid/cls-decl-fields-invalid-syntax.template +/*--- +description: SyntaxError (class declaration) +esid: prod-ClassElement +features: [class-fields-public, class] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + x y +} diff --git a/test/language/statements/class/syntax-error-grammar-privatename-no-initializer-with-method.js b/test/language/statements/class/syntax-error-grammar-privatename-no-initializer-with-method.js new file mode 100644 index 0000000000..1014356e35 --- /dev/null +++ b/test/language/statements/class/syntax-error-grammar-privatename-no-initializer-with-method.js @@ -0,0 +1,35 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-no-initializer-with-method.case +// - src/class-fields/syntax/invalid/cls-decl-fields-invalid-syntax.template +/*--- +description: SyntaxError (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + #x + m() {} +} diff --git a/test/language/statements/class/syntax-error-grammar-privatename.js b/test/language/statements/class/syntax-error-grammar-privatename.js new file mode 100644 index 0000000000..e92dadf3ac --- /dev/null +++ b/test/language/statements/class/syntax-error-grammar-privatename.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename.case +// - src/class-fields/syntax/invalid/cls-decl-fields-invalid-syntax.template +/*--- +description: SyntaxError (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + # x +} diff --git a/test/language/statements/class/syntax-error-grammar-privatenames.js b/test/language/statements/class/syntax-error-grammar-privatenames.js new file mode 100644 index 0000000000..503031c6bd --- /dev/null +++ b/test/language/statements/class/syntax-error-grammar-privatenames.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatenames.case +// - src/class-fields/syntax/invalid/cls-decl-fields-invalid-syntax.template +/*--- +description: SyntaxError (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + #x #y +} diff --git a/test/language/statements/class/syntax-invalid-grammar-field-def-has-initializer-no-sc-error.js b/test/language/statements/class/syntax-invalid-grammar-field-def-has-initializer-no-sc-error.js new file mode 100644 index 0000000000..b0eb3a3a07 --- /dev/null +++ b/test/language/statements/class/syntax-invalid-grammar-field-def-has-initializer-no-sc-error.js @@ -0,0 +1,35 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-field-def-has-initializer-no-sc-error.case +// - src/class-fields/syntax/invalid/cls-decl-fields-invalid-syntax.template +/*--- +description: SyntaxError (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + x = [] + y; +} diff --git a/test/language/statements/class/syntax-invalid-grammar-field-identifier-invalid-ues-error.js b/test/language/statements/class/syntax-invalid-grammar-field-identifier-invalid-ues-error.js new file mode 100644 index 0000000000..f0a7779408 --- /dev/null +++ b/test/language/statements/class/syntax-invalid-grammar-field-identifier-invalid-ues-error.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-field-identifier-invalid-ues-error.case +// - src/class-fields/syntax/invalid/cls-decl-fields-invalid-syntax.template +/*--- +description: Valid FieldDefinition, ClassElementName, PropertyName Syntax (class declaration) +esid: prod-ClassElement +features: [class-fields-public, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + StringLiteral + NumericLiteral + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart :: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart :: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue :: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + \u0000; +} diff --git a/test/language/statements/class/syntax-invalid-grammar-field-identifier-invalid-zwj-error.js b/test/language/statements/class/syntax-invalid-grammar-field-identifier-invalid-zwj-error.js new file mode 100644 index 0000000000..5bc7632b4d --- /dev/null +++ b/test/language/statements/class/syntax-invalid-grammar-field-identifier-invalid-zwj-error.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-field-identifier-invalid-zwj-error.case +// - src/class-fields/syntax/invalid/cls-decl-fields-invalid-syntax.template +/*--- +description: Valid FieldDefinition, ClassElementName, PropertyName Syntax (class declaration) +esid: prod-ClassElement +features: [class-fields-public, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + StringLiteral + NumericLiteral + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart :: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart :: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue :: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + \u200D_ZWJ; +} diff --git a/test/language/statements/class/syntax-invalid-grammar-field-identifier-invalid-zwnj-error.js b/test/language/statements/class/syntax-invalid-grammar-field-identifier-invalid-zwnj-error.js new file mode 100644 index 0000000000..638f1ca522 --- /dev/null +++ b/test/language/statements/class/syntax-invalid-grammar-field-identifier-invalid-zwnj-error.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-field-identifier-invalid-zwnj-error.case +// - src/class-fields/syntax/invalid/cls-decl-fields-invalid-syntax.template +/*--- +description: Valid FieldDefinition, ClassElementName, PropertyName Syntax (class declaration) +esid: prod-ClassElement +features: [class-fields-public, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + StringLiteral + NumericLiteral + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart :: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart :: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue :: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + \u200C_ZWNJ; +} diff --git a/test/language/statements/class/syntax-invalid-grammar-fields-same-line-error.js b/test/language/statements/class/syntax-invalid-grammar-fields-same-line-error.js new file mode 100644 index 0000000000..feafa0013b --- /dev/null +++ b/test/language/statements/class/syntax-invalid-grammar-fields-same-line-error.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-fields-same-line-error.case +// - src/class-fields/syntax/invalid/cls-decl-fields-invalid-syntax.template +/*--- +description: SyntaxError (class declaration) +esid: prod-ClassElement +features: [class-fields-public, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + x y +} diff --git a/test/language/statements/class/syntax-invalid-grammar-privatename-error.js b/test/language/statements/class/syntax-invalid-grammar-privatename-error.js new file mode 100644 index 0000000000..7ddf739086 --- /dev/null +++ b/test/language/statements/class/syntax-invalid-grammar-privatename-error.js @@ -0,0 +1,37 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-error.case +// - src/class-fields/syntax/invalid/cls-decl-fields-invalid-syntax.template +/*--- +description: SyntaxError (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + # x +} diff --git a/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-invalid-ues.js b/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-invalid-ues.js new file mode 100644 index 0000000000..95e59adab0 --- /dev/null +++ b/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-invalid-ues.js @@ -0,0 +1,65 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-invalid-ues.case +// - src/class-fields/syntax/invalid/cls-decl-fields-invalid-syntax.template +/*--- +description: Valid PrivateName Syntax (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + #\u0000; +} diff --git a/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-invalid-zwj-error.js b/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-invalid-zwj-error.js new file mode 100644 index 0000000000..052e5c8493 --- /dev/null +++ b/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-invalid-zwj-error.js @@ -0,0 +1,66 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-invalid-zwj-error.case +// - src/class-fields/syntax/invalid/cls-decl-fields-invalid-syntax.template +/*--- +description: Valid PrivateName Syntax (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + #\u200D_ZWJ; + +} diff --git a/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-invalid-zwnj-error.js b/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-invalid-zwnj-error.js new file mode 100644 index 0000000000..accdca3be8 --- /dev/null +++ b/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-invalid-zwnj-error.js @@ -0,0 +1,66 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-invalid-zwnj-error.case +// - src/class-fields/syntax/invalid/cls-decl-fields-invalid-syntax.template +/*--- +description: Valid PrivateName Syntax (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + #\u200C_ZWNJ; + +} diff --git a/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-non-id-start-error.js b/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-non-id-start-error.js new file mode 100644 index 0000000000..01562653b4 --- /dev/null +++ b/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-non-id-start-error.js @@ -0,0 +1,65 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-non-id-start-error.case +// - src/class-fields/syntax/invalid/cls-decl-fields-invalid-syntax.template +/*--- +description: Valid PrivateName Syntax (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + #\u{00}; +} diff --git a/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-non-ues-error.js b/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-non-ues-error.js new file mode 100644 index 0000000000..5dfa380f04 --- /dev/null +++ b/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-non-ues-error.js @@ -0,0 +1,65 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-non-ues-error.case +// - src/class-fields/syntax/invalid/cls-decl-fields-invalid-syntax.template +/*--- +description: Valid PrivateName Syntax (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + #\u0000; +} diff --git a/test/language/statements/class/syntax-invalid-grammar-privatenames-same-line-error.js b/test/language/statements/class/syntax-invalid-grammar-privatenames-same-line-error.js new file mode 100644 index 0000000000..c76d611923 --- /dev/null +++ b/test/language/statements/class/syntax-invalid-grammar-privatenames-same-line-error.js @@ -0,0 +1,37 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatenames-same-line-error.case +// - src/class-fields/syntax/invalid/cls-decl-fields-invalid-syntax.template +/*--- +description: SyntaxError (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + #x #y +} diff --git a/test/language/statements/class/syntax-valid-grammar-field-classelementname-initializer-alt.js b/test/language/statements/class/syntax-valid-grammar-field-classelementname-initializer-alt.js new file mode 100644 index 0000000000..dc2cccaed3 --- /dev/null +++ b/test/language/statements/class/syntax-valid-grammar-field-classelementname-initializer-alt.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-field-classelementname-initializer-alt.case +// - src/class-fields/syntax/valid/cls-decl-fields-valid-syntax.template +/*--- +description: FieldDefinition, ClassElementName, PropertyName = Initializer Syntax (class declaration) +esid: prod-ClassElement +features: [class-fields-public, class] +flags: [generated] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + Initializer : + = AssignmentExpression + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart :: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart :: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue :: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + $ = 1; + _ = 2; + \u{6F} = 3; + ℘ = 4; // DO NOT CHANGE THE NAME OF THIS FIELD + ZW_‌_NJ = 5; // DO NOT CHANGE THE NAME OF THIS FIELD + ZW_‍_J = 6; // DO NOT CHANGE THE NAME OF THIS FIELD +} diff --git a/test/language/statements/class/syntax-valid-grammar-field-classelementname-initializer.js b/test/language/statements/class/syntax-valid-grammar-field-classelementname-initializer.js new file mode 100644 index 0000000000..843cd646de --- /dev/null +++ b/test/language/statements/class/syntax-valid-grammar-field-classelementname-initializer.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-field-classelementname-initializer.case +// - src/class-fields/syntax/valid/cls-decl-fields-valid-syntax.template +/*--- +description: FieldDefinition, ClassElementName, PropertyName = Initializer Syntax (class declaration) +esid: prod-ClassElement +features: [class-fields-public, class] +flags: [generated] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + Initializer : + = AssignmentExpression + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart :: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart :: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue :: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + $ = 1; + _ = 2; + \u{6F} = 3; + \u2118 = 4; + ZW_\u200C_NJ = 5; + ZW_\u200D_J = 6; +} diff --git a/test/language/statements/class/syntax-valid-grammar-field-identifier-alt.js b/test/language/statements/class/syntax-valid-grammar-field-identifier-alt.js new file mode 100644 index 0000000000..23bc067205 --- /dev/null +++ b/test/language/statements/class/syntax-valid-grammar-field-identifier-alt.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-field-identifier-alt.case +// - src/class-fields/syntax/valid/cls-decl-fields-valid-syntax.template +/*--- +description: Valid FieldDefinition, ClassElementName, PropertyName Syntax (class declaration) +esid: prod-ClassElement +features: [class-fields-public, class] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + StringLiteral + NumericLiteral + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart :: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart :: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue :: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + $; + _; + \u{6F}; + ℘; // DO NOT CHANGE THE NAME OF THIS FIELD + ZW_‌_NJ; // DO NOT CHANGE THE NAME OF THIS FIELD + ZW_‍_J; // DO NOT CHANGE THE NAME OF THIS FIELD +} diff --git a/test/language/statements/class/syntax-valid-grammar-field-identifier.js b/test/language/statements/class/syntax-valid-grammar-field-identifier.js new file mode 100644 index 0000000000..6100975d82 --- /dev/null +++ b/test/language/statements/class/syntax-valid-grammar-field-identifier.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-field-identifier.case +// - src/class-fields/syntax/valid/cls-decl-fields-valid-syntax.template +/*--- +description: Valid FieldDefinition, ClassElementName, PropertyName Syntax (class declaration) +esid: prod-ClassElement +features: [class-fields-public, class] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + StringLiteral + NumericLiteral + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart :: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart :: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue :: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + $; + _; + \u{6F}; + \u2118; + ZW_\u200C_NJ; + ZW_\u200D_J; +} diff --git a/test/language/statements/class/syntax-valid-grammar-fields-multi-line.js b/test/language/statements/class/syntax-valid-grammar-fields-multi-line.js new file mode 100644 index 0000000000..cb260398d5 --- /dev/null +++ b/test/language/statements/class/syntax-valid-grammar-fields-multi-line.js @@ -0,0 +1,30 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-fields-multi-line.case +// - src/class-fields/syntax/valid/cls-decl-fields-valid-syntax.template +/*--- +description: SyntaxError (class declaration) +esid: prod-ClassElement +features: [class-fields-public, class] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + +---*/ + + +class C { + x + y +} diff --git a/test/language/statements/class/syntax-valid-grammar-privatename-classelementname-initializer-alt.js b/test/language/statements/class/syntax-valid-grammar-privatename-classelementname-initializer-alt.js new file mode 100644 index 0000000000..76f969b204 --- /dev/null +++ b/test/language/statements/class/syntax-valid-grammar-privatename-classelementname-initializer-alt.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-classelementname-initializer-alt.case +// - src/class-fields/syntax/valid/cls-decl-fields-valid-syntax.template +/*--- +description: Valid PrivateName = Initializer Syntax (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + Initializer : + = AssignmentExpression + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + #$ = 1; + #_ = 2; + #\u{6F} = 3; + #℘ = 4; // DO NOT CHANGE THE NAME OF THIS FIELD + #ZW_‌_NJ = 5; // DO NOT CHANGE THE NAME OF THIS FIELD + #ZW_‍_J = 6; // DO NOT CHANGE THE NAME OF THIS FIELD +} diff --git a/test/language/statements/class/syntax-valid-grammar-privatename-classelementname-initializer.js b/test/language/statements/class/syntax-valid-grammar-privatename-classelementname-initializer.js new file mode 100644 index 0000000000..3f97f1e0a3 --- /dev/null +++ b/test/language/statements/class/syntax-valid-grammar-privatename-classelementname-initializer.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-classelementname-initializer.case +// - src/class-fields/syntax/valid/cls-decl-fields-valid-syntax.template +/*--- +description: Valid PrivateName = Initializer Syntax (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + Initializer : + = AssignmentExpression + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + #$ = 1; + #_ = 2; + #\u{6F} = 3; + #\u2118 = 4; + #ZW_\u200C_NJ = 5; + #ZW_\u200D_J = 6; +} diff --git a/test/language/statements/class/syntax-valid-grammar-privatename-identifier.js b/test/language/statements/class/syntax-valid-grammar-privatename-identifier.js new file mode 100644 index 0000000000..dfe6c3703c --- /dev/null +++ b/test/language/statements/class/syntax-valid-grammar-privatename-identifier.js @@ -0,0 +1,65 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier.case +// - src/class-fields/syntax/valid/cls-decl-fields-valid-syntax.template +/*--- +description: Valid PrivateName Syntax (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + #$; + #_; + #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J; +} diff --git a/test/language/statements/class/syntax-valid-grammar-privatename-no-initializer-with-method.js b/test/language/statements/class/syntax-valid-grammar-privatename-no-initializer-with-method.js new file mode 100644 index 0000000000..93b9728f6c --- /dev/null +++ b/test/language/statements/class/syntax-valid-grammar-privatename-no-initializer-with-method.js @@ -0,0 +1,33 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-no-initializer-with-method.case +// - src/class-fields/syntax/valid/cls-decl-fields-valid-syntax.template +/*--- +description: SyntaxError (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + +---*/ + + +class C { + #x + m() {} +} diff --git a/test/language/statements/class/syntax-valid-grammar-privatenames-multi-line.js b/test/language/statements/class/syntax-valid-grammar-privatenames-multi-line.js new file mode 100644 index 0000000000..0bef1fab1a --- /dev/null +++ b/test/language/statements/class/syntax-valid-grammar-privatenames-multi-line.js @@ -0,0 +1,33 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatenames-multi-line.case +// - src/class-fields/syntax/valid/cls-decl-fields-valid-syntax.template +/*--- +description: SyntaxError (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + +---*/ + + +class C { + #x + #y +}