diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-private-getter-alt.js b/test/language/expressions/class/fields-after-same-line-gen-rs-private-getter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..0846bdb5c6f196619e090bf37280bab8a46c9bc2 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-private-getter-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter-alt.case +// - src/class-elements/productions/cls-expr-after-same-line-gen.template +/*--- +description: Valid PrivateName as private getter (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #℘() { + return this.#℘_; + } + get #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + get #ZW_â€_J() { + return this.#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-private-getter.js b/test/language/expressions/class/fields-after-same-line-gen-rs-private-getter.js new file mode 100644 index 0000000000000000000000000000000000000000..47b1200ed70bd7bb149619a4d0a05e0dcd9a0805 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-private-getter.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter.case +// - src/class-elements/productions/cls-expr-after-same-line-gen.template +/*--- +description: Valid PrivateName as private getter (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #\u2118() { + return this.#\u2118_; + } + get #ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ_; + } + get #ZW_\u200D_J() { + return this.#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-private-method-alt.js b/test/language/expressions/class/fields-after-same-line-gen-rs-private-method-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..8347b20c4be020b616349e33e15c59b303357039 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-private-method-alt.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method-alt.case +// - src/class-elements/productions/cls-expr-after-same-line-gen.template +/*--- +description: Valid PrivateName as private method (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + return this.#$_; + } + #_() { + return this.#__; + } + #\u{6F}() { + return this.#\u{6F}_; + } + #℘() { + return this.#℘_; + } + #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + #ZW_â€_J() { + return this.#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-private-method.js b/test/language/expressions/class/fields-after-same-line-gen-rs-private-method.js new file mode 100644 index 0000000000000000000000000000000000000000..0e32af45e4ebd93f4efd0af94458ffa6a413a4b4 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-private-method.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method.case +// - src/class-elements/productions/cls-expr-after-same-line-gen.template +/*--- +description: Valid PrivateName as private method (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + 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_; + } +; + $(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-private-setter-alt.js b/test/language/expressions/class/fields-after-same-line-gen-rs-private-setter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..8fcb77823b409888064a78d9d91a9138ce91b437 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-private-setter-alt.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter-alt.case +// - src/class-elements/productions/cls-expr-after-same-line-gen.template +/*--- +description: Valid PrivateName as private setter (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #℘(value) { + this.#℘_ = value; + } + set #ZW_‌_NJ(value) { + this.#ZW_‌_NJ_ = value; + } + set #ZW_â€_J(value) { + this.#ZW_â€_J_ = value; + } +; + $(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-private-setter.js b/test/language/expressions/class/fields-after-same-line-gen-rs-private-setter.js new file mode 100644 index 0000000000000000000000000000000000000000..464368ceae8de041c6ac7dfb6df54fec0dbdb4a7 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-private-setter.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter.case +// - src/class-elements/productions/cls-expr-after-same-line-gen.template +/*--- +description: Valid PrivateName as private setter (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #\u2118(value) { + this.#\u2118_ = value; + } + set #ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ_ = value; + } + set #ZW_\u200D_J(value) { + this.#ZW_\u200D_J_ = value; + } +; + $(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-method-rs-private-getter-alt.js b/test/language/expressions/class/fields-after-same-line-method-rs-private-getter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..5d9d266bd705450d5cffd8b65f4b74ab4180b6fc --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-rs-private-getter-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter-alt.case +// - src/class-elements/productions/cls-expr-after-same-line-method.template +/*--- +description: Valid PrivateName as private getter (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #℘() { + return this.#℘_; + } + get #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + get #ZW_â€_J() { + return this.#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-private-getter.js b/test/language/expressions/class/fields-after-same-line-method-rs-private-getter.js new file mode 100644 index 0000000000000000000000000000000000000000..a1f3e84183ab05fc6bbe86480684c50921925ef3 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-rs-private-getter.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter.case +// - src/class-elements/productions/cls-expr-after-same-line-method.template +/*--- +description: Valid PrivateName as private getter (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #\u2118() { + return this.#\u2118_; + } + get #ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ_; + } + get #ZW_\u200D_J() { + return this.#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-private-method-alt.js b/test/language/expressions/class/fields-after-same-line-method-rs-private-method-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..d58cd1cf2327d2eae27ccc8bce83a6ecc4372c5a --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-rs-private-method-alt.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method-alt.case +// - src/class-elements/productions/cls-expr-after-same-line-method.template +/*--- +description: Valid PrivateName as private method (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + return this.#$_; + } + #_() { + return this.#__; + } + #\u{6F}() { + return this.#\u{6F}_; + } + #℘() { + return this.#℘_; + } + #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + #ZW_â€_J() { + return this.#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-private-method.js b/test/language/expressions/class/fields-after-same-line-method-rs-private-method.js new file mode 100644 index 0000000000000000000000000000000000000000..d5592fff50957f1bcf3e5347c738754a1abe0c48 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-rs-private-method.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method.case +// - src/class-elements/productions/cls-expr-after-same-line-method.template +/*--- +description: Valid PrivateName as private method (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + 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_; + } +; + $(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-private-setter-alt.js b/test/language/expressions/class/fields-after-same-line-method-rs-private-setter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..11974677fabb383007c34868cd24b071812887a2 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-rs-private-setter-alt.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter-alt.case +// - src/class-elements/productions/cls-expr-after-same-line-method.template +/*--- +description: Valid PrivateName as private setter (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #℘(value) { + this.#℘_ = value; + } + set #ZW_‌_NJ(value) { + this.#ZW_‌_NJ_ = value; + } + set #ZW_â€_J(value) { + this.#ZW_â€_J_ = value; + } +; + $(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-private-setter.js b/test/language/expressions/class/fields-after-same-line-method-rs-private-setter.js new file mode 100644 index 0000000000000000000000000000000000000000..4094da7f8a5071ad2efa87e3e3a3b93359744e0d --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-rs-private-setter.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter.case +// - src/class-elements/productions/cls-expr-after-same-line-method.template +/*--- +description: Valid PrivateName as private setter (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #\u2118(value) { + this.#\u2118_ = value; + } + set #ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ_ = value; + } + set #ZW_\u200D_J(value) { + this.#ZW_\u200D_J_ = value; + } +; + $(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-static-async-gen-rs-private-getter-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-private-getter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..15e958607093436664ebad52d53bbe870c4c094a --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-private-getter-alt.js @@ -0,0 +1,138 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter-alt.case +// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Valid PrivateName as private getter (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #℘() { + return this.#℘_; + } + get #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + get #ZW_â€_J() { + return this.#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}); + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-private-getter.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-private-getter.js new file mode 100644 index 0000000000000000000000000000000000000000..59d094014bde5655e8762434a5e6a70ba98bc0da --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-private-getter.js @@ -0,0 +1,138 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter.case +// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Valid PrivateName as private getter (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #\u2118() { + return this.#\u2118_; + } + get #ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ_; + } + get #ZW_\u200D_J() { + return this.#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}); + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-private-method-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-private-method-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..a1fc6596d934d85b302c266440aca1010e2e31c2 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-private-method-alt.js @@ -0,0 +1,137 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method-alt.case +// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Valid PrivateName as private method (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + return this.#$_; + } + #_() { + return this.#__; + } + #\u{6F}() { + return this.#\u{6F}_; + } + #℘() { + return this.#℘_; + } + #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + #ZW_â€_J() { + return this.#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}); + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-private-method.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-private-method.js new file mode 100644 index 0000000000000000000000000000000000000000..0e24eb6054289e19560c7eaf4b008844aae2b28d --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-private-method.js @@ -0,0 +1,137 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method.case +// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Valid PrivateName as private method (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + 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_; + } +; + $(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}); + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-private-setter-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-private-setter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..2beff9192840492eba6e019e46d66e5b5af1e785 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-private-setter-alt.js @@ -0,0 +1,137 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter-alt.case +// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Valid PrivateName as private setter (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #℘(value) { + this.#℘_ = value; + } + set #ZW_‌_NJ(value) { + this.#ZW_‌_NJ_ = value; + } + set #ZW_â€_J(value) { + this.#ZW_â€_J_ = value; + } +; + $(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}); + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-private-setter.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-private-setter.js new file mode 100644 index 0000000000000000000000000000000000000000..006b883bc6237f6e0aa79f5954b3bfbde5a7897f --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-private-setter.js @@ -0,0 +1,137 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter.case +// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Valid PrivateName as private setter (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #\u2118(value) { + this.#\u2118_ = value; + } + set #ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ_ = value; + } + set #ZW_\u200D_J(value) { + this.#ZW_\u200D_J_ = value; + } +; + $(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}); + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-private-getter-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-private-getter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..83c0c99a7187bddd5f53b2e22d14a125034ba22d --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-private-getter-alt.js @@ -0,0 +1,137 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter-alt.case +// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Valid PrivateName as private getter (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #℘() { + return this.#℘_; + } + get #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + get #ZW_â€_J() { + return this.#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}); + +C.m().then(function(v) { + assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-private-getter.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-private-getter.js new file mode 100644 index 0000000000000000000000000000000000000000..a0d83b9d6f4ce57f50cff944e5b4d95b59b19b81 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-private-getter.js @@ -0,0 +1,137 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter.case +// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Valid PrivateName as private getter (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #\u2118() { + return this.#\u2118_; + } + get #ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ_; + } + get #ZW_\u200D_J() { + return this.#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}); + +C.m().then(function(v) { + assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-private-method-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-private-method-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..7ce270d2b33362360a28905536ad7e4332f3f34c --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-private-method-alt.js @@ -0,0 +1,136 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method-alt.case +// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Valid PrivateName as private method (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + return this.#$_; + } + #_() { + return this.#__; + } + #\u{6F}() { + return this.#\u{6F}_; + } + #℘() { + return this.#℘_; + } + #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + #ZW_â€_J() { + return this.#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}); + +C.m().then(function(v) { + assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-private-method.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-private-method.js new file mode 100644 index 0000000000000000000000000000000000000000..888f6b77f77350982b6dfbb90e2b292964ffcb0c --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-private-method.js @@ -0,0 +1,136 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method.case +// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Valid PrivateName as private method (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + 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_; + } +; + $(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}); + +C.m().then(function(v) { + assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-private-setter-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-private-setter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..6fa1f360ce66124e394599f4b10878e0a0e12905 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-private-setter-alt.js @@ -0,0 +1,136 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter-alt.case +// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Valid PrivateName as private setter (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #℘(value) { + this.#℘_ = value; + } + set #ZW_‌_NJ(value) { + this.#ZW_‌_NJ_ = value; + } + set #ZW_â€_J(value) { + this.#ZW_â€_J_ = value; + } +; + $(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}); + +C.m().then(function(v) { + assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-private-setter.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-private-setter.js new file mode 100644 index 0000000000000000000000000000000000000000..eadeec5eda43f872fbe1e98ccc4ab4bc9446a585 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-private-setter.js @@ -0,0 +1,136 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter.case +// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Valid PrivateName as private setter (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #\u2118(value) { + this.#\u2118_ = value; + } + set #ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ_ = value; + } + set #ZW_\u200D_J(value) { + this.#ZW_\u200D_J_ = value; + } +; + $(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}); + +C.m().then(function(v) { + assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-private-getter-alt.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-private-getter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..7ef213e45d998175ebfb8535ddab4acd26c0ca7b --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-private-getter-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter-alt.case +// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Valid PrivateName as private getter (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #℘() { + return this.#℘_; + } + get #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + get #ZW_â€_J() { + return this.#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-private-getter.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-private-getter.js new file mode 100644 index 0000000000000000000000000000000000000000..30e9788b7e7fed94d1b510587dc253583d100207 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-private-getter.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter.case +// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Valid PrivateName as private getter (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #\u2118() { + return this.#\u2118_; + } + get #ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ_; + } + get #ZW_\u200D_J() { + return this.#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-private-method-alt.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-private-method-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..bae9b9dd78218fa018d61950678b522eb1f5cb47 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-private-method-alt.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method-alt.case +// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Valid PrivateName as private method (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + return this.#$_; + } + #_() { + return this.#__; + } + #\u{6F}() { + return this.#\u{6F}_; + } + #℘() { + return this.#℘_; + } + #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + #ZW_â€_J() { + return this.#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-private-method.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-private-method.js new file mode 100644 index 0000000000000000000000000000000000000000..cc93cd18c670505e40657fd3db265b851e344cd0 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-private-method.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method.case +// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Valid PrivateName as private method (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + 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_; + } +; + $(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-private-setter-alt.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-private-setter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..0744df631fed755832982c7ba7d772c59cdc541c --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-private-setter-alt.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter-alt.case +// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Valid PrivateName as private setter (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #℘(value) { + this.#℘_ = value; + } + set #ZW_‌_NJ(value) { + this.#ZW_‌_NJ_ = value; + } + set #ZW_â€_J(value) { + this.#ZW_â€_J_ = value; + } +; + $(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-private-setter.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-private-setter.js new file mode 100644 index 0000000000000000000000000000000000000000..3b8e2ebc13927009a920042dc87893fda0379da9 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-private-setter.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter.case +// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Valid PrivateName as private setter (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #\u2118(value) { + this.#\u2118_ = value; + } + set #ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ_ = value; + } + set #ZW_\u200D_J(value) { + this.#ZW_\u200D_J_ = value; + } +; + $(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-method-rs-private-getter-alt.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-private-getter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..134f927ac9ea229a23b12720a34134076b5b6089 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-private-getter-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter-alt.case +// - src/class-elements/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Valid PrivateName as private getter (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #℘() { + return this.#℘_; + } + get #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + get #ZW_â€_J() { + return this.#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-private-getter.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-private-getter.js new file mode 100644 index 0000000000000000000000000000000000000000..5625f6b2b828c2749d272b92ae1ea5cf26c16f51 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-private-getter.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter.case +// - src/class-elements/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Valid PrivateName as private getter (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #\u2118() { + return this.#\u2118_; + } + get #ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ_; + } + get #ZW_\u200D_J() { + return this.#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-private-method-alt.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-private-method-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..3011e4e5ed33db3ba50a2c61172bb37b4bfb4772 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-private-method-alt.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method-alt.case +// - src/class-elements/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Valid PrivateName as private method (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + return this.#$_; + } + #_() { + return this.#__; + } + #\u{6F}() { + return this.#\u{6F}_; + } + #℘() { + return this.#℘_; + } + #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + #ZW_â€_J() { + return this.#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-private-method.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-private-method.js new file mode 100644 index 0000000000000000000000000000000000000000..28bfe73b7d19c831d2be2a040bfd36b93c3a4d96 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-private-method.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method.case +// - src/class-elements/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Valid PrivateName as private method (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + 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_; + } +; + $(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-private-setter-alt.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-private-setter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..8b2ea2f81f8dba328bf220c640af9ab7d5c545b1 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-private-setter-alt.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter-alt.case +// - src/class-elements/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Valid PrivateName as private setter (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #℘(value) { + this.#℘_ = value; + } + set #ZW_‌_NJ(value) { + this.#ZW_‌_NJ_ = value; + } + set #ZW_â€_J(value) { + this.#ZW_â€_J_ = value; + } +; + $(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-private-setter.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-private-setter.js new file mode 100644 index 0000000000000000000000000000000000000000..a68ead7096284dbc2a9d8d790fd012fda6708920 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-private-setter.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter.case +// - src/class-elements/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Valid PrivateName as private setter (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #\u2118(value) { + this.#\u2118_ = value; + } + set #ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ_ = value; + } + set #ZW_\u200D_J(value) { + this.#ZW_\u200D_J_ = value; + } +; + $(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-multiple-definitions-rs-private-getter-alt.js b/test/language/expressions/class/fields-multiple-definitions-rs-private-getter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..d5f4370340814c5454af3be05187af0d3dcd5980 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-rs-private-getter-alt.js @@ -0,0 +1,160 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter-alt.case +// - src/class-elements/productions/cls-expr-multiple-definitions.template +/*--- +description: Valid PrivateName as private getter (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #℘() { + return this.#℘_; + } + get #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + get #ZW_â€_J() { + return this.#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-private-getter.js b/test/language/expressions/class/fields-multiple-definitions-rs-private-getter.js new file mode 100644 index 0000000000000000000000000000000000000000..2010c8f637cef8cc7dafef0efb06bd35ed88f287 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-rs-private-getter.js @@ -0,0 +1,160 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter.case +// - src/class-elements/productions/cls-expr-multiple-definitions.template +/*--- +description: Valid PrivateName as private getter (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #\u2118() { + return this.#\u2118_; + } + get #ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ_; + } + get #ZW_\u200D_J() { + return this.#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-private-method-alt.js b/test/language/expressions/class/fields-multiple-definitions-rs-private-method-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..2bc07d2afe191aa179317dd6e214362715e70616 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-rs-private-method-alt.js @@ -0,0 +1,159 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method-alt.case +// - src/class-elements/productions/cls-expr-multiple-definitions.template +/*--- +description: Valid PrivateName as private method (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + return this.#$_; + } + #_() { + return this.#__; + } + #\u{6F}() { + return this.#\u{6F}_; + } + #℘() { + return this.#℘_; + } + #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + #ZW_â€_J() { + return this.#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-private-method.js b/test/language/expressions/class/fields-multiple-definitions-rs-private-method.js new file mode 100644 index 0000000000000000000000000000000000000000..94a720e162064241aa47033a362549d650ca45a0 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-rs-private-method.js @@ -0,0 +1,159 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method.case +// - src/class-elements/productions/cls-expr-multiple-definitions.template +/*--- +description: Valid PrivateName as private method (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + 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_; + } + + 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-private-setter-alt.js b/test/language/expressions/class/fields-multiple-definitions-rs-private-setter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..a9cae825d561be62184c1794e982685f17a158f0 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-rs-private-setter-alt.js @@ -0,0 +1,159 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter-alt.case +// - src/class-elements/productions/cls-expr-multiple-definitions.template +/*--- +description: Valid PrivateName as private setter (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #℘(value) { + this.#℘_ = value; + } + set #ZW_‌_NJ(value) { + this.#ZW_‌_NJ_ = value; + } + set #ZW_â€_J(value) { + this.#ZW_â€_J_ = value; + } + + 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-private-setter.js b/test/language/expressions/class/fields-multiple-definitions-rs-private-setter.js new file mode 100644 index 0000000000000000000000000000000000000000..087c5ae5eb8c2cb8c8bc410b15dd5c5c86366161 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-rs-private-setter.js @@ -0,0 +1,159 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter.case +// - src/class-elements/productions/cls-expr-multiple-definitions.template +/*--- +description: Valid PrivateName as private setter (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #\u2118(value) { + this.#\u2118_ = value; + } + set #ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ_ = value; + } + set #ZW_\u200D_J(value) { + this.#ZW_\u200D_J_ = value; + } + + 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-stacked-definitions-rs-private-getter-alt.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-private-getter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..5e5006847c7ba25d27341c1628673423001e1b28 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-private-getter-alt.js @@ -0,0 +1,138 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter-alt.case +// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Valid PrivateName as private getter (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #℘() { + return this.#℘_; + } + get #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + get #ZW_â€_J() { + return this.#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-private-getter.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-private-getter.js new file mode 100644 index 0000000000000000000000000000000000000000..f34f0d638b808d5194b77e44a50c3fa5fb8dcaed --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-private-getter.js @@ -0,0 +1,138 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter.case +// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Valid PrivateName as private getter (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #\u2118() { + return this.#\u2118_; + } + get #ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ_; + } + get #ZW_\u200D_J() { + return this.#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-private-method-alt.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-private-method-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..94e053b8e2a6417ab7b8b8c19dacd200a7f5d43a --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-private-method-alt.js @@ -0,0 +1,137 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method-alt.case +// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Valid PrivateName as private method (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + return this.#$_; + } + #_() { + return this.#__; + } + #\u{6F}() { + return this.#\u{6F}_; + } + #℘() { + return this.#℘_; + } + #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + #ZW_â€_J() { + return this.#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-private-method.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-private-method.js new file mode 100644 index 0000000000000000000000000000000000000000..0938322d887ad00efc1cfe0e1951c4969ec7e55b --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-private-method.js @@ -0,0 +1,137 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method.case +// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Valid PrivateName as private method (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + 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_; + } + + 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-private-setter-alt.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-private-setter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..89c936e12173927d0f8c710ef9ea4c8abaa9f684 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-private-setter-alt.js @@ -0,0 +1,137 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter-alt.case +// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Valid PrivateName as private setter (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #℘(value) { + this.#℘_ = value; + } + set #ZW_‌_NJ(value) { + this.#ZW_‌_NJ_ = value; + } + set #ZW_â€_J(value) { + this.#ZW_â€_J_ = value; + } + + 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-private-setter.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-private-setter.js new file mode 100644 index 0000000000000000000000000000000000000000..2819687272baed1b32e347c1cd9c4c9f43f3617a --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-private-setter.js @@ -0,0 +1,137 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter.case +// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Valid PrivateName as private setter (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #\u2118(value) { + this.#\u2118_ = value; + } + set #ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ_ = value; + } + set #ZW_\u200D_J(value) { + this.#ZW_\u200D_J_ = value; + } + + 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-new-no-sc-line-method-rs-private-getter-alt.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-private-getter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..5f5ee6c001261a6d22fe628ba20e8cd2bd97043e --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-private-getter-alt.js @@ -0,0 +1,125 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter-alt.case +// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Valid PrivateName as private getter (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #℘() { + return this.#℘_; + } + get #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + get #ZW_â€_J() { + return this.#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-private-getter.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-private-getter.js new file mode 100644 index 0000000000000000000000000000000000000000..a7468b52bd5fe3eec36db3cd957c3f24548cab5b --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-private-getter.js @@ -0,0 +1,125 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter.case +// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Valid PrivateName as private getter (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #\u2118() { + return this.#\u2118_; + } + get #ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ_; + } + get #ZW_\u200D_J() { + return this.#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-private-method-alt.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-private-method-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..36c2b69c30c4b4457823ca2ef5e523696f53771c --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-private-method-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method-alt.case +// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Valid PrivateName as private method (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + return this.#$_; + } + #_() { + return this.#__; + } + #\u{6F}() { + return this.#\u{6F}_; + } + #℘() { + return this.#℘_; + } + #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + #ZW_â€_J() { + return this.#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-private-method.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-private-method.js new file mode 100644 index 0000000000000000000000000000000000000000..17258d04f288d977cddc0d060c68688cc8b910e8 --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-private-method.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method.case +// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Valid PrivateName as private method (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + 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_; + } + + 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-private-setter-alt.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-private-setter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..36e75cb189b5086f069d46711bebea88038c5058 --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-private-setter-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter-alt.case +// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Valid PrivateName as private setter (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #℘(value) { + this.#℘_ = value; + } + set #ZW_‌_NJ(value) { + this.#ZW_‌_NJ_ = value; + } + set #ZW_â€_J(value) { + this.#ZW_â€_J_ = value; + } + + 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-private-setter.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-private-setter.js new file mode 100644 index 0000000000000000000000000000000000000000..e2e1faea64de7df44dc55c97ff01f2d749f7b462 --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-private-setter.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter.case +// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Valid PrivateName as private setter (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #\u2118(value) { + this.#\u2118_ = value; + } + set #ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ_ = value; + } + set #ZW_\u200D_J(value) { + this.#ZW_\u200D_J_ = value; + } + + 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-gen-rs-private-getter-alt.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-private-getter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..930e00381669dc07b354851976555de368b3d199 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-private-getter-alt.js @@ -0,0 +1,125 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter-alt.case +// - src/class-elements/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Valid PrivateName as private getter (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #℘() { + return this.#℘_; + } + get #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + get #ZW_â€_J() { + return this.#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-private-getter.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-private-getter.js new file mode 100644 index 0000000000000000000000000000000000000000..d9ca66bbc1902c8366c94f107f5608564e666664 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-private-getter.js @@ -0,0 +1,125 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter.case +// - src/class-elements/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Valid PrivateName as private getter (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #\u2118() { + return this.#\u2118_; + } + get #ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ_; + } + get #ZW_\u200D_J() { + return this.#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-private-method-alt.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-private-method-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..3cb147b83e0b1925282ea1b0af61a75918080ac5 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-private-method-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method-alt.case +// - src/class-elements/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Valid PrivateName as private method (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + return this.#$_; + } + #_() { + return this.#__; + } + #\u{6F}() { + return this.#\u{6F}_; + } + #℘() { + return this.#℘_; + } + #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + #ZW_â€_J() { + return this.#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-private-method.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-private-method.js new file mode 100644 index 0000000000000000000000000000000000000000..ba3f2cc1fe9abc7d153f806e30fd6933c4408cb1 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-private-method.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method.case +// - src/class-elements/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Valid PrivateName as private method (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + 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_; + } +; + *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-private-setter-alt.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-private-setter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..57d08c5838ae576ce63c6327627321af0d7c86f3 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-private-setter-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter-alt.case +// - src/class-elements/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Valid PrivateName as private setter (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #℘(value) { + this.#℘_ = value; + } + set #ZW_‌_NJ(value) { + this.#ZW_‌_NJ_ = value; + } + set #ZW_â€_J(value) { + this.#ZW_â€_J_ = value; + } +; + *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-private-setter.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-private-setter.js new file mode 100644 index 0000000000000000000000000000000000000000..43bcafef969d43bda36590a7915e3723b8098219 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-private-setter.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter.case +// - src/class-elements/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Valid PrivateName as private setter (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #\u2118(value) { + this.#\u2118_ = value; + } + set #ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ_ = value; + } + set #ZW_\u200D_J(value) { + this.#ZW_\u200D_J_ = value; + } +; + *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-method-rs-private-getter-alt.js b/test/language/expressions/class/fields-new-sc-line-method-rs-private-getter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..9cf149fa92c0e94afbe854f4234bcefd6c0ae655 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-private-getter-alt.js @@ -0,0 +1,125 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter-alt.case +// - src/class-elements/productions/cls-expr-new-sc-line-method.template +/*--- +description: Valid PrivateName as private getter (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #℘() { + return this.#℘_; + } + get #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + get #ZW_â€_J() { + return this.#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-private-getter.js b/test/language/expressions/class/fields-new-sc-line-method-rs-private-getter.js new file mode 100644 index 0000000000000000000000000000000000000000..18eb997b3462b3e9bfc6b53bee51b7f4eafb3530 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-private-getter.js @@ -0,0 +1,125 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter.case +// - src/class-elements/productions/cls-expr-new-sc-line-method.template +/*--- +description: Valid PrivateName as private getter (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #\u2118() { + return this.#\u2118_; + } + get #ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ_; + } + get #ZW_\u200D_J() { + return this.#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-private-method-alt.js b/test/language/expressions/class/fields-new-sc-line-method-rs-private-method-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..d8cfbe73589e790772f05ae046c6c8d81af86113 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-private-method-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method-alt.case +// - src/class-elements/productions/cls-expr-new-sc-line-method.template +/*--- +description: Valid PrivateName as private method (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + return this.#$_; + } + #_() { + return this.#__; + } + #\u{6F}() { + return this.#\u{6F}_; + } + #℘() { + return this.#℘_; + } + #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + #ZW_â€_J() { + return this.#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-private-method.js b/test/language/expressions/class/fields-new-sc-line-method-rs-private-method.js new file mode 100644 index 0000000000000000000000000000000000000000..d75edbee0fdae6eee157759e633a9399b8b1ae9b --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-private-method.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method.case +// - src/class-elements/productions/cls-expr-new-sc-line-method.template +/*--- +description: Valid PrivateName as private method (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + 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_; + } +; + 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-private-setter-alt.js b/test/language/expressions/class/fields-new-sc-line-method-rs-private-setter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..7e1e57f8cde129e533ab0542e8da429da51d4168 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-private-setter-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter-alt.case +// - src/class-elements/productions/cls-expr-new-sc-line-method.template +/*--- +description: Valid PrivateName as private setter (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #℘(value) { + this.#℘_ = value; + } + set #ZW_‌_NJ(value) { + this.#ZW_‌_NJ_ = value; + } + set #ZW_â€_J(value) { + this.#ZW_â€_J_ = value; + } +; + 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-private-setter.js b/test/language/expressions/class/fields-new-sc-line-method-rs-private-setter.js new file mode 100644 index 0000000000000000000000000000000000000000..ac0a83881ece947ef572b1342de0c6ce16126093 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-private-setter.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter.case +// - src/class-elements/productions/cls-expr-new-sc-line-method.template +/*--- +description: Valid PrivateName as private setter (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #\u2118(value) { + this.#\u2118_ = value; + } + set #ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ_ = value; + } + set #ZW_\u200D_J(value) { + this.#ZW_\u200D_J_ = value; + } +; + 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-regular-definitions-rs-private-getter-alt.js b/test/language/expressions/class/fields-regular-definitions-rs-private-getter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..74fca1d8c60002be9ae8309486ca9abe4d5a4ec4 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-rs-private-getter-alt.js @@ -0,0 +1,113 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter-alt.case +// - src/class-elements/productions/cls-expr-regular-definitions.template +/*--- +description: Valid PrivateName as private getter (regular fields defintion) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #℘() { + return this.#℘_; + } + get #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + get #ZW_â€_J() { + return this.#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-private-getter.js b/test/language/expressions/class/fields-regular-definitions-rs-private-getter.js new file mode 100644 index 0000000000000000000000000000000000000000..00be66f642e8baeb26808fb5aaea48f45c4a74c7 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-rs-private-getter.js @@ -0,0 +1,113 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter.case +// - src/class-elements/productions/cls-expr-regular-definitions.template +/*--- +description: Valid PrivateName as private getter (regular fields defintion) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #\u2118() { + return this.#\u2118_; + } + get #ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ_; + } + get #ZW_\u200D_J() { + return this.#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-private-method-alt.js b/test/language/expressions/class/fields-regular-definitions-rs-private-method-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..f501aa8eec3a9a42652647863e7e63f3bebc1234 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-rs-private-method-alt.js @@ -0,0 +1,112 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method-alt.case +// - src/class-elements/productions/cls-expr-regular-definitions.template +/*--- +description: Valid PrivateName as private method (regular fields defintion) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + return this.#$_; + } + #_() { + return this.#__; + } + #\u{6F}() { + return this.#\u{6F}_; + } + #℘() { + return this.#℘_; + } + #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + #ZW_â€_J() { + return this.#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-private-method.js b/test/language/expressions/class/fields-regular-definitions-rs-private-method.js new file mode 100644 index 0000000000000000000000000000000000000000..09c6846e18751408be004506aee5a9102abff416 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-rs-private-method.js @@ -0,0 +1,112 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method.case +// - src/class-elements/productions/cls-expr-regular-definitions.template +/*--- +description: Valid PrivateName as private method (regular fields defintion) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + 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_; + } + + $(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-private-setter-alt.js b/test/language/expressions/class/fields-regular-definitions-rs-private-setter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..e80cf18fa10e1a9efa242d781e9c0f3e9d579743 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-rs-private-setter-alt.js @@ -0,0 +1,112 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter-alt.case +// - src/class-elements/productions/cls-expr-regular-definitions.template +/*--- +description: Valid PrivateName as private setter (regular fields defintion) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #℘(value) { + this.#℘_ = value; + } + set #ZW_‌_NJ(value) { + this.#ZW_‌_NJ_ = value; + } + set #ZW_â€_J(value) { + this.#ZW_â€_J_ = value; + } + + $(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-private-setter.js b/test/language/expressions/class/fields-regular-definitions-rs-private-setter.js new file mode 100644 index 0000000000000000000000000000000000000000..543638ef464d7563efd314366f2e2ce52447e939 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-rs-private-setter.js @@ -0,0 +1,112 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter.case +// - src/class-elements/productions/cls-expr-regular-definitions.template +/*--- +description: Valid PrivateName as private setter (regular fields defintion) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #\u2118(value) { + this.#\u2118_ = value; + } + set #ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ_ = value; + } + set #ZW_\u200D_J(value) { + this.#ZW_\u200D_J_ = value; + } + + $(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-same-line-async-gen-rs-private-getter-alt.js b/test/language/expressions/class/fields-same-line-async-gen-rs-private-getter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..c05828bafe17df15e4d096ddedcaa1bff1356d30 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-private-getter-alt.js @@ -0,0 +1,138 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter-alt.case +// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Valid PrivateName as private getter (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #℘() { + return this.#℘_; + } + get #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + get #ZW_â€_J() { + return this.#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}); + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-private-getter.js b/test/language/expressions/class/fields-same-line-async-gen-rs-private-getter.js new file mode 100644 index 0000000000000000000000000000000000000000..c2a37e211fcf2a261c9143df3cc9a3fef90c8951 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-private-getter.js @@ -0,0 +1,138 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter.case +// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Valid PrivateName as private getter (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #\u2118() { + return this.#\u2118_; + } + get #ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ_; + } + get #ZW_\u200D_J() { + return this.#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}); + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-private-method-alt.js b/test/language/expressions/class/fields-same-line-async-gen-rs-private-method-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..791743177ccb62cfbec36e0dd3023708ed33f821 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-private-method-alt.js @@ -0,0 +1,137 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method-alt.case +// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Valid PrivateName as private method (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + return this.#$_; + } + #_() { + return this.#__; + } + #\u{6F}() { + return this.#\u{6F}_; + } + #℘() { + return this.#℘_; + } + #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + #ZW_â€_J() { + return this.#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}); + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-private-method.js b/test/language/expressions/class/fields-same-line-async-gen-rs-private-method.js new file mode 100644 index 0000000000000000000000000000000000000000..f1ab8b04caea744e450fc2ce8b5bdc1c5a86f5d1 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-private-method.js @@ -0,0 +1,137 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method.case +// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Valid PrivateName as private method (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + 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_; + } +; + $(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}); + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-private-setter-alt.js b/test/language/expressions/class/fields-same-line-async-gen-rs-private-setter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..48e082f7e3a6e60b9186b4bb71c401f3de84a2d7 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-private-setter-alt.js @@ -0,0 +1,137 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter-alt.case +// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Valid PrivateName as private setter (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #℘(value) { + this.#℘_ = value; + } + set #ZW_‌_NJ(value) { + this.#ZW_‌_NJ_ = value; + } + set #ZW_â€_J(value) { + this.#ZW_â€_J_ = value; + } +; + $(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}); + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-private-setter.js b/test/language/expressions/class/fields-same-line-async-gen-rs-private-setter.js new file mode 100644 index 0000000000000000000000000000000000000000..4a10cba9e7f252ced03a5e6609566be63f3674d1 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-private-setter.js @@ -0,0 +1,137 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter.case +// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Valid PrivateName as private setter (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #\u2118(value) { + this.#\u2118_ = value; + } + set #ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ_ = value; + } + set #ZW_\u200D_J(value) { + this.#ZW_\u200D_J_ = value; + } +; + $(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}); + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-private-getter-alt.js b/test/language/expressions/class/fields-same-line-async-method-rs-private-getter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..5237e5a0a60b2d1aacb501f3b7921f6e0f349144 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-rs-private-getter-alt.js @@ -0,0 +1,137 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter-alt.case +// - src/class-elements/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Valid PrivateName as private getter (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #℘() { + return this.#℘_; + } + get #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + get #ZW_â€_J() { + return this.#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}); + +c.m().then(function(v) { + assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-private-getter.js b/test/language/expressions/class/fields-same-line-async-method-rs-private-getter.js new file mode 100644 index 0000000000000000000000000000000000000000..0f9886f7f4bbae4d8f4ed85855fe106520ce5c8a --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-rs-private-getter.js @@ -0,0 +1,137 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter.case +// - src/class-elements/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Valid PrivateName as private getter (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #\u2118() { + return this.#\u2118_; + } + get #ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ_; + } + get #ZW_\u200D_J() { + return this.#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}); + +c.m().then(function(v) { + assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-private-method-alt.js b/test/language/expressions/class/fields-same-line-async-method-rs-private-method-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..9c7fcddbec696dafb187581af0a8ebb10e56b529 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-rs-private-method-alt.js @@ -0,0 +1,136 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method-alt.case +// - src/class-elements/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Valid PrivateName as private method (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + return this.#$_; + } + #_() { + return this.#__; + } + #\u{6F}() { + return this.#\u{6F}_; + } + #℘() { + return this.#℘_; + } + #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + #ZW_â€_J() { + return this.#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}); + +c.m().then(function(v) { + assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-private-method.js b/test/language/expressions/class/fields-same-line-async-method-rs-private-method.js new file mode 100644 index 0000000000000000000000000000000000000000..b3d14fec4a394d979d467397fe5cc18de57f5471 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-rs-private-method.js @@ -0,0 +1,136 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method.case +// - src/class-elements/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Valid PrivateName as private method (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + 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_; + } +; + $(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}); + +c.m().then(function(v) { + assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-private-setter-alt.js b/test/language/expressions/class/fields-same-line-async-method-rs-private-setter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..bd985fb5d7665bda7bf9fedf497e7a991ae4a8ff --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-rs-private-setter-alt.js @@ -0,0 +1,136 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter-alt.case +// - src/class-elements/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Valid PrivateName as private setter (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #℘(value) { + this.#℘_ = value; + } + set #ZW_‌_NJ(value) { + this.#ZW_‌_NJ_ = value; + } + set #ZW_â€_J(value) { + this.#ZW_â€_J_ = value; + } +; + $(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}); + +c.m().then(function(v) { + assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-private-setter.js b/test/language/expressions/class/fields-same-line-async-method-rs-private-setter.js new file mode 100644 index 0000000000000000000000000000000000000000..5e627015ddcda27270d3193f27a1e0b58fd07267 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-rs-private-setter.js @@ -0,0 +1,136 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter.case +// - src/class-elements/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Valid PrivateName as private setter (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #\u2118(value) { + this.#\u2118_ = value; + } + set #ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ_ = value; + } + set #ZW_\u200D_J(value) { + this.#ZW_\u200D_J_ = value; + } +; + $(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}); + +c.m().then(function(v) { + assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-gen-rs-private-getter-alt.js b/test/language/expressions/class/fields-same-line-gen-rs-private-getter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..24c45127132f349262dd1b471c0ce048103c24ad --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-rs-private-getter-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter-alt.case +// - src/class-elements/productions/cls-expr-same-line-generator.template +/*--- +description: Valid PrivateName as private getter (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #℘() { + return this.#℘_; + } + get #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + get #ZW_â€_J() { + return this.#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-private-getter.js b/test/language/expressions/class/fields-same-line-gen-rs-private-getter.js new file mode 100644 index 0000000000000000000000000000000000000000..b95d0ce7aea93260ceb157ab477a14f22f9c52cc --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-rs-private-getter.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter.case +// - src/class-elements/productions/cls-expr-same-line-generator.template +/*--- +description: Valid PrivateName as private getter (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #\u2118() { + return this.#\u2118_; + } + get #ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ_; + } + get #ZW_\u200D_J() { + return this.#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-private-method-alt.js b/test/language/expressions/class/fields-same-line-gen-rs-private-method-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..09d63692e7407c73daeee9664108a5ba26100520 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-rs-private-method-alt.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method-alt.case +// - src/class-elements/productions/cls-expr-same-line-generator.template +/*--- +description: Valid PrivateName as private method (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + return this.#$_; + } + #_() { + return this.#__; + } + #\u{6F}() { + return this.#\u{6F}_; + } + #℘() { + return this.#℘_; + } + #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + #ZW_â€_J() { + return this.#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-private-method.js b/test/language/expressions/class/fields-same-line-gen-rs-private-method.js new file mode 100644 index 0000000000000000000000000000000000000000..95cf2f7118551b20487b0512d9710275503e16f4 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-rs-private-method.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method.case +// - src/class-elements/productions/cls-expr-same-line-generator.template +/*--- +description: Valid PrivateName as private method (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + 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_; + } +; *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-private-setter-alt.js b/test/language/expressions/class/fields-same-line-gen-rs-private-setter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..df30d9064469b4cd628554d225b88d5b7a3c1e0e --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-rs-private-setter-alt.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter-alt.case +// - src/class-elements/productions/cls-expr-same-line-generator.template +/*--- +description: Valid PrivateName as private setter (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #℘(value) { + this.#℘_ = value; + } + set #ZW_‌_NJ(value) { + this.#ZW_‌_NJ_ = value; + } + set #ZW_â€_J(value) { + this.#ZW_â€_J_ = value; + } +; *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-private-setter.js b/test/language/expressions/class/fields-same-line-gen-rs-private-setter.js new file mode 100644 index 0000000000000000000000000000000000000000..707e73f9e8b3b3fee931219c8a11a26ca75cfba1 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-rs-private-setter.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter.case +// - src/class-elements/productions/cls-expr-same-line-generator.template +/*--- +description: Valid PrivateName as private setter (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #\u2118(value) { + this.#\u2118_ = value; + } + set #ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ_ = value; + } + set #ZW_\u200D_J(value) { + this.#ZW_\u200D_J_ = value; + } +; *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-method-rs-private-getter-alt.js b/test/language/expressions/class/fields-same-line-method-rs-private-getter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..0709d7c3bc4e818d7e9b35b75aa7aeee3ddeb6f3 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-rs-private-getter-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter-alt.case +// - src/class-elements/productions/cls-expr-same-line-method.template +/*--- +description: Valid PrivateName as private getter (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #℘() { + return this.#℘_; + } + get #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + get #ZW_â€_J() { + return this.#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-private-getter.js b/test/language/expressions/class/fields-same-line-method-rs-private-getter.js new file mode 100644 index 0000000000000000000000000000000000000000..30e69a1667b93e4405a4652c35ed490ddb42c78d --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-rs-private-getter.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter.case +// - src/class-elements/productions/cls-expr-same-line-method.template +/*--- +description: Valid PrivateName as private getter (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #\u2118() { + return this.#\u2118_; + } + get #ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ_; + } + get #ZW_\u200D_J() { + return this.#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-private-method-alt.js b/test/language/expressions/class/fields-same-line-method-rs-private-method-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..d80370febf8438b4113e22959e0124802e0d5dd1 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-rs-private-method-alt.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method-alt.case +// - src/class-elements/productions/cls-expr-same-line-method.template +/*--- +description: Valid PrivateName as private method (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + return this.#$_; + } + #_() { + return this.#__; + } + #\u{6F}() { + return this.#\u{6F}_; + } + #℘() { + return this.#℘_; + } + #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + #ZW_â€_J() { + return this.#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-private-method.js b/test/language/expressions/class/fields-same-line-method-rs-private-method.js new file mode 100644 index 0000000000000000000000000000000000000000..27f1e03e344ddecd63dee9b7da68f65d70c9beab --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-rs-private-method.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method.case +// - src/class-elements/productions/cls-expr-same-line-method.template +/*--- +description: Valid PrivateName as private method (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + 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_; + } +; 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-private-setter-alt.js b/test/language/expressions/class/fields-same-line-method-rs-private-setter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..83b8cc8d0becaea8b4250f452c7ce8add7bf9002 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-rs-private-setter-alt.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter-alt.case +// - src/class-elements/productions/cls-expr-same-line-method.template +/*--- +description: Valid PrivateName as private setter (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #℘(value) { + this.#℘_ = value; + } + set #ZW_‌_NJ(value) { + this.#ZW_‌_NJ_ = value; + } + set #ZW_â€_J(value) { + this.#ZW_â€_J_ = value; + } +; 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-private-setter.js b/test/language/expressions/class/fields-same-line-method-rs-private-setter.js new file mode 100644 index 0000000000000000000000000000000000000000..43c3a88f7887fca5870f6c477e4a96c559dba7a1 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-rs-private-setter.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter.case +// - src/class-elements/productions/cls-expr-same-line-method.template +/*--- +description: Valid PrivateName as private setter (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #\u2118(value) { + this.#\u2118_ = value; + } + set #ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ_ = value; + } + set #ZW_\u200D_J(value) { + this.#ZW_\u200D_J_ = value; + } +; 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-wrapped-in-sc-rs-private-getter-alt.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-private-getter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..943dee7486200d286e64395ee1d1663dcc2d9333 --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-private-getter-alt.js @@ -0,0 +1,115 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter-alt.case +// - src/class-elements/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Valid PrivateName as private getter (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #℘() { + return this.#℘_; + } + get #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + get #ZW_â€_J() { + return this.#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-private-getter.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-private-getter.js new file mode 100644 index 0000000000000000000000000000000000000000..91b135d6e912c737f5f951f871dfa3d9a9817b94 --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-private-getter.js @@ -0,0 +1,115 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter.case +// - src/class-elements/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Valid PrivateName as private getter (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #\u2118() { + return this.#\u2118_; + } + get #ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ_; + } + get #ZW_\u200D_J() { + return this.#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-private-method-alt.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-private-method-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..cbd4d82a29eee1bea128587dda7e6bf45560d1d6 --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-private-method-alt.js @@ -0,0 +1,114 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method-alt.case +// - src/class-elements/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Valid PrivateName as private method (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + return this.#$_; + } + #_() { + return this.#__; + } + #\u{6F}() { + return this.#\u{6F}_; + } + #℘() { + return this.#℘_; + } + #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + #ZW_â€_J() { + return this.#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-private-method.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-private-method.js new file mode 100644 index 0000000000000000000000000000000000000000..6e28689dc20780ab5d691ddde7eb4a8d5e04d64f --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-private-method.js @@ -0,0 +1,114 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method.case +// - src/class-elements/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Valid PrivateName as private method (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + 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_; + } +;;;;;;; + ;;;; + $(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-private-setter-alt.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-private-setter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..323f69633371c4b310dd7eeb7126ba8c3890b890 --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-private-setter-alt.js @@ -0,0 +1,114 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter-alt.case +// - src/class-elements/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Valid PrivateName as private setter (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #℘(value) { + this.#℘_ = value; + } + set #ZW_‌_NJ(value) { + this.#ZW_‌_NJ_ = value; + } + set #ZW_â€_J(value) { + this.#ZW_â€_J_ = value; + } +;;;;;;; + ;;;; + $(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-private-setter.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-private-setter.js new file mode 100644 index 0000000000000000000000000000000000000000..fbb765044072f8c80dc3aadc84dd4de087e30f19 --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-private-setter.js @@ -0,0 +1,114 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter.case +// - src/class-elements/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Valid PrivateName as private setter (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #\u2118(value) { + this.#\u2118_ = value; + } + set #ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ_ = value; + } + set #ZW_\u200D_J(value) { + this.#ZW_\u200D_J_ = value; + } +;;;;;;; + ;;;; + $(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-after-same-line-gen-rs-private-getter-alt.js b/test/language/statements/class/fields-after-same-line-gen-rs-private-getter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..e5dc54a22a4d3d5787f6d92730ac460417c24079 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-rs-private-getter-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter-alt.case +// - src/class-elements/productions/cls-decl-after-same-line-gen.template +/*--- +description: Valid PrivateName as private getter (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #℘() { + return this.#℘_; + } + get #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + get #ZW_â€_J() { + return this.#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-private-getter.js b/test/language/statements/class/fields-after-same-line-gen-rs-private-getter.js new file mode 100644 index 0000000000000000000000000000000000000000..c924141568d57361d419c6d6b7213f4107068f4d --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-rs-private-getter.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter.case +// - src/class-elements/productions/cls-decl-after-same-line-gen.template +/*--- +description: Valid PrivateName as private getter (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #\u2118() { + return this.#\u2118_; + } + get #ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ_; + } + get #ZW_\u200D_J() { + return this.#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-private-method-alt.js b/test/language/statements/class/fields-after-same-line-gen-rs-private-method-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..05b6d74c39138eeca6da2b42b6bcb309aa37cd5f --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-rs-private-method-alt.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method-alt.case +// - src/class-elements/productions/cls-decl-after-same-line-gen.template +/*--- +description: Valid PrivateName as private method (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + return this.#$_; + } + #_() { + return this.#__; + } + #\u{6F}() { + return this.#\u{6F}_; + } + #℘() { + return this.#℘_; + } + #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + #ZW_â€_J() { + return this.#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-private-method.js b/test/language/statements/class/fields-after-same-line-gen-rs-private-method.js new file mode 100644 index 0000000000000000000000000000000000000000..569cf8f240e23cfa12f2fb6c8467af9e26297d5e --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-rs-private-method.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method.case +// - src/class-elements/productions/cls-decl-after-same-line-gen.template +/*--- +description: Valid PrivateName as private method (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + 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_; + } +; + $(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-private-setter-alt.js b/test/language/statements/class/fields-after-same-line-gen-rs-private-setter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..a96aef8bf04647de0954b60c05aab4b68bfc8e67 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-rs-private-setter-alt.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter-alt.case +// - src/class-elements/productions/cls-decl-after-same-line-gen.template +/*--- +description: Valid PrivateName as private setter (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #℘(value) { + this.#℘_ = value; + } + set #ZW_‌_NJ(value) { + this.#ZW_‌_NJ_ = value; + } + set #ZW_â€_J(value) { + this.#ZW_â€_J_ = value; + } +; + $(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-private-setter.js b/test/language/statements/class/fields-after-same-line-gen-rs-private-setter.js new file mode 100644 index 0000000000000000000000000000000000000000..2e01f8de023f1bf135f221e7b19be9fea679b8d2 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-rs-private-setter.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter.case +// - src/class-elements/productions/cls-decl-after-same-line-gen.template +/*--- +description: Valid PrivateName as private setter (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #\u2118(value) { + this.#\u2118_ = value; + } + set #ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ_ = value; + } + set #ZW_\u200D_J(value) { + this.#ZW_\u200D_J_ = value; + } +; + $(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-method-rs-private-getter-alt.js b/test/language/statements/class/fields-after-same-line-method-rs-private-getter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..ccaaecaa4ae0982b15281921bb3d997a97f3ef8d --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-rs-private-getter-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter-alt.case +// - src/class-elements/productions/cls-decl-after-same-line-method.template +/*--- +description: Valid PrivateName as private getter (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #℘() { + return this.#℘_; + } + get #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + get #ZW_â€_J() { + return this.#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-private-getter.js b/test/language/statements/class/fields-after-same-line-method-rs-private-getter.js new file mode 100644 index 0000000000000000000000000000000000000000..8944f129ad429db78d46f1179db342a66d4e4dd5 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-rs-private-getter.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter.case +// - src/class-elements/productions/cls-decl-after-same-line-method.template +/*--- +description: Valid PrivateName as private getter (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #\u2118() { + return this.#\u2118_; + } + get #ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ_; + } + get #ZW_\u200D_J() { + return this.#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-private-method-alt.js b/test/language/statements/class/fields-after-same-line-method-rs-private-method-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..3a5f94b4e52245be540f0fa80f3e6d9428452213 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-rs-private-method-alt.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method-alt.case +// - src/class-elements/productions/cls-decl-after-same-line-method.template +/*--- +description: Valid PrivateName as private method (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + return this.#$_; + } + #_() { + return this.#__; + } + #\u{6F}() { + return this.#\u{6F}_; + } + #℘() { + return this.#℘_; + } + #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + #ZW_â€_J() { + return this.#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-private-method.js b/test/language/statements/class/fields-after-same-line-method-rs-private-method.js new file mode 100644 index 0000000000000000000000000000000000000000..d209c4647b6f198ed6d86f9f53494da2bae7993e --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-rs-private-method.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method.case +// - src/class-elements/productions/cls-decl-after-same-line-method.template +/*--- +description: Valid PrivateName as private method (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + 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_; + } +; + $(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-private-setter-alt.js b/test/language/statements/class/fields-after-same-line-method-rs-private-setter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..931ce95e0fe6e4de79de65d5cacb3ffbadc1f740 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-rs-private-setter-alt.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter-alt.case +// - src/class-elements/productions/cls-decl-after-same-line-method.template +/*--- +description: Valid PrivateName as private setter (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #℘(value) { + this.#℘_ = value; + } + set #ZW_‌_NJ(value) { + this.#ZW_‌_NJ_ = value; + } + set #ZW_â€_J(value) { + this.#ZW_â€_J_ = value; + } +; + $(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-private-setter.js b/test/language/statements/class/fields-after-same-line-method-rs-private-setter.js new file mode 100644 index 0000000000000000000000000000000000000000..473da4c8ae49567b96c8af9bcfed4c163e301b6d --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-rs-private-setter.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter.case +// - src/class-elements/productions/cls-decl-after-same-line-method.template +/*--- +description: Valid PrivateName as private setter (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #\u2118(value) { + this.#\u2118_ = value; + } + set #ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ_ = value; + } + set #ZW_\u200D_J(value) { + this.#ZW_\u200D_J_ = value; + } +; + $(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-static-async-gen-rs-private-getter-alt.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-private-getter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..f1c13718e36ce5fb6f4b25650fb5a772b2526a9e --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-private-getter-alt.js @@ -0,0 +1,138 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter-alt.case +// - src/class-elements/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Valid PrivateName as private getter (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #℘() { + return this.#℘_; + } + get #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + get #ZW_â€_J() { + return this.#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}); + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-private-getter.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-private-getter.js new file mode 100644 index 0000000000000000000000000000000000000000..b7e69c7ef5658273acf1b0a278d4ba90997db699 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-private-getter.js @@ -0,0 +1,138 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter.case +// - src/class-elements/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Valid PrivateName as private getter (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #\u2118() { + return this.#\u2118_; + } + get #ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ_; + } + get #ZW_\u200D_J() { + return this.#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}); + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-private-method-alt.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-private-method-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..c585e6f6e0fe6710193add6c4758adcb13373be1 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-private-method-alt.js @@ -0,0 +1,137 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method-alt.case +// - src/class-elements/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Valid PrivateName as private method (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + return this.#$_; + } + #_() { + return this.#__; + } + #\u{6F}() { + return this.#\u{6F}_; + } + #℘() { + return this.#℘_; + } + #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + #ZW_â€_J() { + return this.#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}); + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-private-method.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-private-method.js new file mode 100644 index 0000000000000000000000000000000000000000..88ad9123bce0ebba01a746d6bb8703ba522f4860 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-private-method.js @@ -0,0 +1,137 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method.case +// - src/class-elements/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Valid PrivateName as private method (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + 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_; + } +; + $(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}); + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-private-setter-alt.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-private-setter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..f52454d55a8eb886877859aba71edf84989186e0 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-private-setter-alt.js @@ -0,0 +1,137 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter-alt.case +// - src/class-elements/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Valid PrivateName as private setter (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #℘(value) { + this.#℘_ = value; + } + set #ZW_‌_NJ(value) { + this.#ZW_‌_NJ_ = value; + } + set #ZW_â€_J(value) { + this.#ZW_â€_J_ = value; + } +; + $(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}); + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-private-setter.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-private-setter.js new file mode 100644 index 0000000000000000000000000000000000000000..0e060f76609e56a7ffc782c25ce8f87f03a9fe87 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-private-setter.js @@ -0,0 +1,137 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter.case +// - src/class-elements/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Valid PrivateName as private setter (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #\u2118(value) { + this.#\u2118_ = value; + } + set #ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ_ = value; + } + set #ZW_\u200D_J(value) { + this.#ZW_\u200D_J_ = value; + } +; + $(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}); + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-private-getter-alt.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-private-getter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..6d92345a980e839b76a55f49e26b49ffcbeaec07 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-private-getter-alt.js @@ -0,0 +1,137 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter-alt.case +// - src/class-elements/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Valid PrivateName as private getter (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #℘() { + return this.#℘_; + } + get #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + get #ZW_â€_J() { + return this.#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}); + +C.m().then(function(v) { + assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-private-getter.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-private-getter.js new file mode 100644 index 0000000000000000000000000000000000000000..4162d28d159c1e112f4a1c69ba54b2b91d804581 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-private-getter.js @@ -0,0 +1,137 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter.case +// - src/class-elements/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Valid PrivateName as private getter (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #\u2118() { + return this.#\u2118_; + } + get #ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ_; + } + get #ZW_\u200D_J() { + return this.#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}); + +C.m().then(function(v) { + assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-private-method-alt.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-private-method-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..dada482f3bb05252fa37f8421410fd166047ae1c --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-private-method-alt.js @@ -0,0 +1,136 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method-alt.case +// - src/class-elements/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Valid PrivateName as private method (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + return this.#$_; + } + #_() { + return this.#__; + } + #\u{6F}() { + return this.#\u{6F}_; + } + #℘() { + return this.#℘_; + } + #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + #ZW_â€_J() { + return this.#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}); + +C.m().then(function(v) { + assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-private-method.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-private-method.js new file mode 100644 index 0000000000000000000000000000000000000000..2bc70ee5b6b1de6a9767210ec3fbc89b79f1a8e1 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-private-method.js @@ -0,0 +1,136 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method.case +// - src/class-elements/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Valid PrivateName as private method (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + 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_; + } +; + $(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}); + +C.m().then(function(v) { + assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-private-setter-alt.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-private-setter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..e532e1bf30cd616301e961eb7559765d1a7c19da --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-private-setter-alt.js @@ -0,0 +1,136 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter-alt.case +// - src/class-elements/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Valid PrivateName as private setter (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #℘(value) { + this.#℘_ = value; + } + set #ZW_‌_NJ(value) { + this.#ZW_‌_NJ_ = value; + } + set #ZW_â€_J(value) { + this.#ZW_â€_J_ = value; + } +; + $(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}); + +C.m().then(function(v) { + assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-private-setter.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-private-setter.js new file mode 100644 index 0000000000000000000000000000000000000000..26358f246825d17a84b265475c94da09b3a22757 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-private-setter.js @@ -0,0 +1,136 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter.case +// - src/class-elements/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Valid PrivateName as private setter (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #\u2118(value) { + this.#\u2118_ = value; + } + set #ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ_ = value; + } + set #ZW_\u200D_J(value) { + this.#ZW_\u200D_J_ = value; + } +; + $(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}); + +C.m().then(function(v) { + assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-private-getter-alt.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-private-getter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..2d015869431a6f2ac01ed9a2b91d8bc2bbce7063 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-private-getter-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter-alt.case +// - src/class-elements/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Valid PrivateName as private getter (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #℘() { + return this.#℘_; + } + get #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + get #ZW_â€_J() { + return this.#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-private-getter.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-private-getter.js new file mode 100644 index 0000000000000000000000000000000000000000..e2237608a74fd3d1ab0aac07af0196993e0ca3a6 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-private-getter.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter.case +// - src/class-elements/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Valid PrivateName as private getter (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #\u2118() { + return this.#\u2118_; + } + get #ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ_; + } + get #ZW_\u200D_J() { + return this.#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-private-method-alt.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-private-method-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..8891365051a8b398f2a31e80b2c4a0fb7e72a281 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-private-method-alt.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method-alt.case +// - src/class-elements/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Valid PrivateName as private method (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + return this.#$_; + } + #_() { + return this.#__; + } + #\u{6F}() { + return this.#\u{6F}_; + } + #℘() { + return this.#℘_; + } + #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + #ZW_â€_J() { + return this.#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-private-method.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-private-method.js new file mode 100644 index 0000000000000000000000000000000000000000..3ca4ea00ad0b90cd2e524df5b6ec5cf174ea0ec0 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-private-method.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method.case +// - src/class-elements/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Valid PrivateName as private method (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + 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_; + } +; + $(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-private-setter-alt.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-private-setter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..bc2c6ed2dfb03d976a11e19a73efec14f85e4db3 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-private-setter-alt.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter-alt.case +// - src/class-elements/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Valid PrivateName as private setter (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #℘(value) { + this.#℘_ = value; + } + set #ZW_‌_NJ(value) { + this.#ZW_‌_NJ_ = value; + } + set #ZW_â€_J(value) { + this.#ZW_â€_J_ = value; + } +; + $(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-private-setter.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-private-setter.js new file mode 100644 index 0000000000000000000000000000000000000000..671bf3bc1ee310be00ce851a53fa91ecee651068 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-private-setter.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter.case +// - src/class-elements/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Valid PrivateName as private setter (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #\u2118(value) { + this.#\u2118_ = value; + } + set #ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ_ = value; + } + set #ZW_\u200D_J(value) { + this.#ZW_\u200D_J_ = value; + } +; + $(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-method-rs-private-getter-alt.js b/test/language/statements/class/fields-after-same-line-static-method-rs-private-getter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..8f196f58c13e489d3b853d0806a79db1c618b5c6 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-private-getter-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter-alt.case +// - src/class-elements/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Valid PrivateName as private getter (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #℘() { + return this.#℘_; + } + get #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + get #ZW_â€_J() { + return this.#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-private-getter.js b/test/language/statements/class/fields-after-same-line-static-method-rs-private-getter.js new file mode 100644 index 0000000000000000000000000000000000000000..2d3b3de621f862522e8a283d56f5dd38eceb80da --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-private-getter.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter.case +// - src/class-elements/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Valid PrivateName as private getter (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #\u2118() { + return this.#\u2118_; + } + get #ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ_; + } + get #ZW_\u200D_J() { + return this.#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-private-method-alt.js b/test/language/statements/class/fields-after-same-line-static-method-rs-private-method-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..fc5115482c2784834b11883bf00cf8fc4a2c6767 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-private-method-alt.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method-alt.case +// - src/class-elements/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Valid PrivateName as private method (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + return this.#$_; + } + #_() { + return this.#__; + } + #\u{6F}() { + return this.#\u{6F}_; + } + #℘() { + return this.#℘_; + } + #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + #ZW_â€_J() { + return this.#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-private-method.js b/test/language/statements/class/fields-after-same-line-static-method-rs-private-method.js new file mode 100644 index 0000000000000000000000000000000000000000..6382c16bcafeba8ca86622d36701eb2263ce9ccd --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-private-method.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method.case +// - src/class-elements/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Valid PrivateName as private method (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + 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_; + } +; + $(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-private-setter-alt.js b/test/language/statements/class/fields-after-same-line-static-method-rs-private-setter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..936857598ecdbf405473953e7bec65897b2e916d --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-private-setter-alt.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter-alt.case +// - src/class-elements/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Valid PrivateName as private setter (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #℘(value) { + this.#℘_ = value; + } + set #ZW_‌_NJ(value) { + this.#ZW_‌_NJ_ = value; + } + set #ZW_â€_J(value) { + this.#ZW_â€_J_ = value; + } +; + $(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-private-setter.js b/test/language/statements/class/fields-after-same-line-static-method-rs-private-setter.js new file mode 100644 index 0000000000000000000000000000000000000000..9811957762902bc0cf1fc8c52d5cbe7735f9dd35 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-private-setter.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter.case +// - src/class-elements/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Valid PrivateName as private setter (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #\u2118(value) { + this.#\u2118_ = value; + } + set #ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ_ = value; + } + set #ZW_\u200D_J(value) { + this.#ZW_\u200D_J_ = value; + } +; + $(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-multiple-definitions-rs-private-getter-alt.js b/test/language/statements/class/fields-multiple-definitions-rs-private-getter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..0391fd82192aa389d9db7466ca035fb3f54c2620 --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-rs-private-getter-alt.js @@ -0,0 +1,160 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter-alt.case +// - src/class-elements/productions/cls-decl-multiple-definitions.template +/*--- +description: Valid PrivateName as private getter (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #℘() { + return this.#℘_; + } + get #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + get #ZW_â€_J() { + return this.#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-private-getter.js b/test/language/statements/class/fields-multiple-definitions-rs-private-getter.js new file mode 100644 index 0000000000000000000000000000000000000000..799837a036bd1bf1c3e4840669d8f9d08557b6a9 --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-rs-private-getter.js @@ -0,0 +1,160 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter.case +// - src/class-elements/productions/cls-decl-multiple-definitions.template +/*--- +description: Valid PrivateName as private getter (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #\u2118() { + return this.#\u2118_; + } + get #ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ_; + } + get #ZW_\u200D_J() { + return this.#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-private-method-alt.js b/test/language/statements/class/fields-multiple-definitions-rs-private-method-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..9c21a93a8fa15a731e30336be42ebb90c1a2df7c --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-rs-private-method-alt.js @@ -0,0 +1,159 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method-alt.case +// - src/class-elements/productions/cls-decl-multiple-definitions.template +/*--- +description: Valid PrivateName as private method (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + return this.#$_; + } + #_() { + return this.#__; + } + #\u{6F}() { + return this.#\u{6F}_; + } + #℘() { + return this.#℘_; + } + #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + #ZW_â€_J() { + return this.#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-private-method.js b/test/language/statements/class/fields-multiple-definitions-rs-private-method.js new file mode 100644 index 0000000000000000000000000000000000000000..75930e440ecd4de30da0b01af9e6901266b88b8e --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-rs-private-method.js @@ -0,0 +1,159 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method.case +// - src/class-elements/productions/cls-decl-multiple-definitions.template +/*--- +description: Valid PrivateName as private method (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + 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_; + } + + 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-private-setter-alt.js b/test/language/statements/class/fields-multiple-definitions-rs-private-setter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..1c5b707ce755067dc508f309874fe00b3a8ee111 --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-rs-private-setter-alt.js @@ -0,0 +1,159 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter-alt.case +// - src/class-elements/productions/cls-decl-multiple-definitions.template +/*--- +description: Valid PrivateName as private setter (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #℘(value) { + this.#℘_ = value; + } + set #ZW_‌_NJ(value) { + this.#ZW_‌_NJ_ = value; + } + set #ZW_â€_J(value) { + this.#ZW_â€_J_ = value; + } + + 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-private-setter.js b/test/language/statements/class/fields-multiple-definitions-rs-private-setter.js new file mode 100644 index 0000000000000000000000000000000000000000..4606e23e8ffa05e7f91e440a65df54b12799b735 --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-rs-private-setter.js @@ -0,0 +1,159 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter.case +// - src/class-elements/productions/cls-decl-multiple-definitions.template +/*--- +description: Valid PrivateName as private setter (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #\u2118(value) { + this.#\u2118_ = value; + } + set #ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ_ = value; + } + set #ZW_\u200D_J(value) { + this.#ZW_\u200D_J_ = value; + } + + 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-stacked-definitions-rs-private-getter-alt.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-private-getter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..29c7d614b9d298b2117720b4198a2ca3e14e7569 --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-private-getter-alt.js @@ -0,0 +1,138 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter-alt.case +// - src/class-elements/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Valid PrivateName as private getter (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #℘() { + return this.#℘_; + } + get #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + get #ZW_â€_J() { + return this.#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-private-getter.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-private-getter.js new file mode 100644 index 0000000000000000000000000000000000000000..b89884068274e9eb01aa3363ab3d1d43f5391246 --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-private-getter.js @@ -0,0 +1,138 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter.case +// - src/class-elements/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Valid PrivateName as private getter (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #\u2118() { + return this.#\u2118_; + } + get #ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ_; + } + get #ZW_\u200D_J() { + return this.#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-private-method-alt.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-private-method-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..d16da2fc15d04fffd207f76bed4e65f6ad3377b5 --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-private-method-alt.js @@ -0,0 +1,137 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method-alt.case +// - src/class-elements/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Valid PrivateName as private method (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + return this.#$_; + } + #_() { + return this.#__; + } + #\u{6F}() { + return this.#\u{6F}_; + } + #℘() { + return this.#℘_; + } + #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + #ZW_â€_J() { + return this.#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-private-method.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-private-method.js new file mode 100644 index 0000000000000000000000000000000000000000..4755e14f7bff1883d0ad2daec09945b36ce4bf91 --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-private-method.js @@ -0,0 +1,137 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method.case +// - src/class-elements/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Valid PrivateName as private method (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + 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_; + } + + 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-private-setter-alt.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-private-setter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..6c7f52f2724f93a0693ede0cab9ca50cc2a81ca5 --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-private-setter-alt.js @@ -0,0 +1,137 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter-alt.case +// - src/class-elements/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Valid PrivateName as private setter (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #℘(value) { + this.#℘_ = value; + } + set #ZW_‌_NJ(value) { + this.#ZW_‌_NJ_ = value; + } + set #ZW_â€_J(value) { + this.#ZW_â€_J_ = value; + } + + 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-private-setter.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-private-setter.js new file mode 100644 index 0000000000000000000000000000000000000000..08b3996599d21d352032ca14f71973398b2fc576 --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-private-setter.js @@ -0,0 +1,137 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter.case +// - src/class-elements/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Valid PrivateName as private setter (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #\u2118(value) { + this.#\u2118_ = value; + } + set #ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ_ = value; + } + set #ZW_\u200D_J(value) { + this.#ZW_\u200D_J_ = value; + } + + 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-new-no-sc-line-method-rs-private-getter-alt.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-private-getter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..dc53142abfa3f6a4d63d9712d0132d2f977a86ba --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-private-getter-alt.js @@ -0,0 +1,125 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter-alt.case +// - src/class-elements/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Valid PrivateName as private getter (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #℘() { + return this.#℘_; + } + get #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + get #ZW_â€_J() { + return this.#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-private-getter.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-private-getter.js new file mode 100644 index 0000000000000000000000000000000000000000..5da9a639aba649b64595af7e8ad081782032cc27 --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-private-getter.js @@ -0,0 +1,125 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter.case +// - src/class-elements/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Valid PrivateName as private getter (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #\u2118() { + return this.#\u2118_; + } + get #ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ_; + } + get #ZW_\u200D_J() { + return this.#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-private-method-alt.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-private-method-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..cc543e44b1f7d1c8d1b29d03681d43d29c78b1e8 --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-private-method-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method-alt.case +// - src/class-elements/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Valid PrivateName as private method (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + return this.#$_; + } + #_() { + return this.#__; + } + #\u{6F}() { + return this.#\u{6F}_; + } + #℘() { + return this.#℘_; + } + #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + #ZW_â€_J() { + return this.#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-private-method.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-private-method.js new file mode 100644 index 0000000000000000000000000000000000000000..9a72325cdcabef054b89b48d1f976caf158f569f --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-private-method.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method.case +// - src/class-elements/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Valid PrivateName as private method (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + 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_; + } + + 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-private-setter-alt.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-private-setter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..bf91cda00cac780dc2b58da6e7016b6d9a3b2731 --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-private-setter-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter-alt.case +// - src/class-elements/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Valid PrivateName as private setter (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #℘(value) { + this.#℘_ = value; + } + set #ZW_‌_NJ(value) { + this.#ZW_‌_NJ_ = value; + } + set #ZW_â€_J(value) { + this.#ZW_â€_J_ = value; + } + + 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-private-setter.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-private-setter.js new file mode 100644 index 0000000000000000000000000000000000000000..1ea793821d0ae3da0d614c85abb17ae7348bc75f --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-private-setter.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter.case +// - src/class-elements/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Valid PrivateName as private setter (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #\u2118(value) { + this.#\u2118_ = value; + } + set #ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ_ = value; + } + set #ZW_\u200D_J(value) { + this.#ZW_\u200D_J_ = value; + } + + 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-gen-rs-private-getter-alt.js b/test/language/statements/class/fields-new-sc-line-gen-rs-private-getter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..671723a7a9adac1bfadf990a7714413a275b0756 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-private-getter-alt.js @@ -0,0 +1,125 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter-alt.case +// - src/class-elements/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Valid PrivateName as private getter (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #℘() { + return this.#℘_; + } + get #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + get #ZW_â€_J() { + return this.#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-private-getter.js b/test/language/statements/class/fields-new-sc-line-gen-rs-private-getter.js new file mode 100644 index 0000000000000000000000000000000000000000..e9ac2d0040e788a032d470d3d588040e987e9f92 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-private-getter.js @@ -0,0 +1,125 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter.case +// - src/class-elements/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Valid PrivateName as private getter (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #\u2118() { + return this.#\u2118_; + } + get #ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ_; + } + get #ZW_\u200D_J() { + return this.#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-private-method-alt.js b/test/language/statements/class/fields-new-sc-line-gen-rs-private-method-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..3d0394f20544a39583da77fb9e606a58d3ec71b0 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-private-method-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method-alt.case +// - src/class-elements/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Valid PrivateName as private method (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + return this.#$_; + } + #_() { + return this.#__; + } + #\u{6F}() { + return this.#\u{6F}_; + } + #℘() { + return this.#℘_; + } + #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + #ZW_â€_J() { + return this.#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-private-method.js b/test/language/statements/class/fields-new-sc-line-gen-rs-private-method.js new file mode 100644 index 0000000000000000000000000000000000000000..20b556e5158c2f87c86fc4e94de278f4e9c68756 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-private-method.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method.case +// - src/class-elements/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Valid PrivateName as private method (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + 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_; + } +; + *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-private-setter-alt.js b/test/language/statements/class/fields-new-sc-line-gen-rs-private-setter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..fb8b633d994eb2fa12dbbbf419aaf698657146f0 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-private-setter-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter-alt.case +// - src/class-elements/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Valid PrivateName as private setter (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #℘(value) { + this.#℘_ = value; + } + set #ZW_‌_NJ(value) { + this.#ZW_‌_NJ_ = value; + } + set #ZW_â€_J(value) { + this.#ZW_â€_J_ = value; + } +; + *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-private-setter.js b/test/language/statements/class/fields-new-sc-line-gen-rs-private-setter.js new file mode 100644 index 0000000000000000000000000000000000000000..7ebdf026673619a6fd032e875edfcbbdb8078750 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-private-setter.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter.case +// - src/class-elements/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Valid PrivateName as private setter (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #\u2118(value) { + this.#\u2118_ = value; + } + set #ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ_ = value; + } + set #ZW_\u200D_J(value) { + this.#ZW_\u200D_J_ = value; + } +; + *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-method-rs-private-getter-alt.js b/test/language/statements/class/fields-new-sc-line-method-rs-private-getter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..961ad4c1f8dd1ca6e46f720e12eb2fe236d57afa --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-rs-private-getter-alt.js @@ -0,0 +1,125 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter-alt.case +// - src/class-elements/productions/cls-decl-new-sc-line-method.template +/*--- +description: Valid PrivateName as private getter (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #℘() { + return this.#℘_; + } + get #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + get #ZW_â€_J() { + return this.#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-private-getter.js b/test/language/statements/class/fields-new-sc-line-method-rs-private-getter.js new file mode 100644 index 0000000000000000000000000000000000000000..e1649e24f98e7c1bee7f4027676a1a430b3e74ea --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-rs-private-getter.js @@ -0,0 +1,125 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter.case +// - src/class-elements/productions/cls-decl-new-sc-line-method.template +/*--- +description: Valid PrivateName as private getter (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #\u2118() { + return this.#\u2118_; + } + get #ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ_; + } + get #ZW_\u200D_J() { + return this.#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-private-method-alt.js b/test/language/statements/class/fields-new-sc-line-method-rs-private-method-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..6aaa3fc3bf0078fc559f0c66140a02e898076653 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-rs-private-method-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method-alt.case +// - src/class-elements/productions/cls-decl-new-sc-line-method.template +/*--- +description: Valid PrivateName as private method (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + return this.#$_; + } + #_() { + return this.#__; + } + #\u{6F}() { + return this.#\u{6F}_; + } + #℘() { + return this.#℘_; + } + #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + #ZW_â€_J() { + return this.#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-private-method.js b/test/language/statements/class/fields-new-sc-line-method-rs-private-method.js new file mode 100644 index 0000000000000000000000000000000000000000..17d30afd1ebb92f69c1113611c544a503b075c71 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-rs-private-method.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method.case +// - src/class-elements/productions/cls-decl-new-sc-line-method.template +/*--- +description: Valid PrivateName as private method (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + 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_; + } +; + 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-private-setter-alt.js b/test/language/statements/class/fields-new-sc-line-method-rs-private-setter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..f25e931123f887b134c9666e65ff3ef544c99fe8 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-rs-private-setter-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter-alt.case +// - src/class-elements/productions/cls-decl-new-sc-line-method.template +/*--- +description: Valid PrivateName as private setter (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #℘(value) { + this.#℘_ = value; + } + set #ZW_‌_NJ(value) { + this.#ZW_‌_NJ_ = value; + } + set #ZW_â€_J(value) { + this.#ZW_â€_J_ = value; + } +; + 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-private-setter.js b/test/language/statements/class/fields-new-sc-line-method-rs-private-setter.js new file mode 100644 index 0000000000000000000000000000000000000000..7f20bca02dac11bff670693aba263a04d96f6e77 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-rs-private-setter.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter.case +// - src/class-elements/productions/cls-decl-new-sc-line-method.template +/*--- +description: Valid PrivateName as private setter (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #\u2118(value) { + this.#\u2118_ = value; + } + set #ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ_ = value; + } + set #ZW_\u200D_J(value) { + this.#ZW_\u200D_J_ = value; + } +; + 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-regular-definitions-rs-private-getter-alt.js b/test/language/statements/class/fields-regular-definitions-rs-private-getter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..eba669744c8656860223e2fdada8a03a883971ba --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-rs-private-getter-alt.js @@ -0,0 +1,113 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter-alt.case +// - src/class-elements/productions/cls-decl-regular-definitions.template +/*--- +description: Valid PrivateName as private getter (regular fields defintion) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #℘() { + return this.#℘_; + } + get #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + get #ZW_â€_J() { + return this.#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-private-getter.js b/test/language/statements/class/fields-regular-definitions-rs-private-getter.js new file mode 100644 index 0000000000000000000000000000000000000000..8c14b434ef7934284ecf03060dc1c5065de398a2 --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-rs-private-getter.js @@ -0,0 +1,113 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter.case +// - src/class-elements/productions/cls-decl-regular-definitions.template +/*--- +description: Valid PrivateName as private getter (regular fields defintion) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #\u2118() { + return this.#\u2118_; + } + get #ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ_; + } + get #ZW_\u200D_J() { + return this.#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-private-method-alt.js b/test/language/statements/class/fields-regular-definitions-rs-private-method-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..e7f999a06b92ac630e46cf5cae9c41df5c365e53 --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-rs-private-method-alt.js @@ -0,0 +1,112 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method-alt.case +// - src/class-elements/productions/cls-decl-regular-definitions.template +/*--- +description: Valid PrivateName as private method (regular fields defintion) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + return this.#$_; + } + #_() { + return this.#__; + } + #\u{6F}() { + return this.#\u{6F}_; + } + #℘() { + return this.#℘_; + } + #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + #ZW_â€_J() { + return this.#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-private-method.js b/test/language/statements/class/fields-regular-definitions-rs-private-method.js new file mode 100644 index 0000000000000000000000000000000000000000..dede9c4aeebbac467a5427a91ef9f33646d0a46d --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-rs-private-method.js @@ -0,0 +1,112 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method.case +// - src/class-elements/productions/cls-decl-regular-definitions.template +/*--- +description: Valid PrivateName as private method (regular fields defintion) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + 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_; + } + + $(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-private-setter-alt.js b/test/language/statements/class/fields-regular-definitions-rs-private-setter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..1aa395b07e88383d66b1853db0ea2b5beec0b557 --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-rs-private-setter-alt.js @@ -0,0 +1,112 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter-alt.case +// - src/class-elements/productions/cls-decl-regular-definitions.template +/*--- +description: Valid PrivateName as private setter (regular fields defintion) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #℘(value) { + this.#℘_ = value; + } + set #ZW_‌_NJ(value) { + this.#ZW_‌_NJ_ = value; + } + set #ZW_â€_J(value) { + this.#ZW_â€_J_ = value; + } + + $(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-private-setter.js b/test/language/statements/class/fields-regular-definitions-rs-private-setter.js new file mode 100644 index 0000000000000000000000000000000000000000..017122f081c0c90bf7dfa10cf6a488f8e28a391a --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-rs-private-setter.js @@ -0,0 +1,112 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter.case +// - src/class-elements/productions/cls-decl-regular-definitions.template +/*--- +description: Valid PrivateName as private setter (regular fields defintion) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #\u2118(value) { + this.#\u2118_ = value; + } + set #ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ_ = value; + } + set #ZW_\u200D_J(value) { + this.#ZW_\u200D_J_ = value; + } + + $(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-same-line-async-gen-rs-private-getter-alt.js b/test/language/statements/class/fields-same-line-async-gen-rs-private-getter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..f87b8f1611c6dd3b68e6eeaf02440eeb2f8906f4 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-rs-private-getter-alt.js @@ -0,0 +1,138 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter-alt.case +// - src/class-elements/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Valid PrivateName as private getter (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #℘() { + return this.#℘_; + } + get #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + get #ZW_â€_J() { + return this.#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}); + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-private-getter.js b/test/language/statements/class/fields-same-line-async-gen-rs-private-getter.js new file mode 100644 index 0000000000000000000000000000000000000000..4db4fbf6626220386b0d971ed5108f1599231c49 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-rs-private-getter.js @@ -0,0 +1,138 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter.case +// - src/class-elements/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Valid PrivateName as private getter (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #\u2118() { + return this.#\u2118_; + } + get #ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ_; + } + get #ZW_\u200D_J() { + return this.#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}); + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-private-method-alt.js b/test/language/statements/class/fields-same-line-async-gen-rs-private-method-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..3c3a9604b9013d2cf7bdbddad1389768e186ff97 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-rs-private-method-alt.js @@ -0,0 +1,137 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method-alt.case +// - src/class-elements/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Valid PrivateName as private method (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + return this.#$_; + } + #_() { + return this.#__; + } + #\u{6F}() { + return this.#\u{6F}_; + } + #℘() { + return this.#℘_; + } + #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + #ZW_â€_J() { + return this.#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}); + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-private-method.js b/test/language/statements/class/fields-same-line-async-gen-rs-private-method.js new file mode 100644 index 0000000000000000000000000000000000000000..cde75ab82433a2c0fecde87d836531e3b3769150 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-rs-private-method.js @@ -0,0 +1,137 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method.case +// - src/class-elements/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Valid PrivateName as private method (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + 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_; + } +; + $(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}); + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-private-setter-alt.js b/test/language/statements/class/fields-same-line-async-gen-rs-private-setter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..b955fd192d5ac4da27353f6423a38c7da501a057 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-rs-private-setter-alt.js @@ -0,0 +1,137 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter-alt.case +// - src/class-elements/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Valid PrivateName as private setter (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #℘(value) { + this.#℘_ = value; + } + set #ZW_‌_NJ(value) { + this.#ZW_‌_NJ_ = value; + } + set #ZW_â€_J(value) { + this.#ZW_â€_J_ = value; + } +; + $(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}); + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-private-setter.js b/test/language/statements/class/fields-same-line-async-gen-rs-private-setter.js new file mode 100644 index 0000000000000000000000000000000000000000..db94b038dab07e88579eec08bfb5ee3b04d83e30 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-rs-private-setter.js @@ -0,0 +1,137 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter.case +// - src/class-elements/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Valid PrivateName as private setter (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #\u2118(value) { + this.#\u2118_ = value; + } + set #ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ_ = value; + } + set #ZW_\u200D_J(value) { + this.#ZW_\u200D_J_ = value; + } +; + $(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}); + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-private-getter-alt.js b/test/language/statements/class/fields-same-line-async-method-rs-private-getter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..ab51b4c016b1f90af905b8e5594e28af351db69c --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-rs-private-getter-alt.js @@ -0,0 +1,137 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter-alt.case +// - src/class-elements/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Valid PrivateName as private getter (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #℘() { + return this.#℘_; + } + get #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + get #ZW_â€_J() { + return this.#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}); + +c.m().then(function(v) { + assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-private-getter.js b/test/language/statements/class/fields-same-line-async-method-rs-private-getter.js new file mode 100644 index 0000000000000000000000000000000000000000..60259c549fd3d35f78598f50aa2dd836fdf77580 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-rs-private-getter.js @@ -0,0 +1,137 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter.case +// - src/class-elements/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Valid PrivateName as private getter (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #\u2118() { + return this.#\u2118_; + } + get #ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ_; + } + get #ZW_\u200D_J() { + return this.#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}); + +c.m().then(function(v) { + assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-private-method-alt.js b/test/language/statements/class/fields-same-line-async-method-rs-private-method-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..ee720d3ffb30961fc1b60d3750887be33ea30d9d --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-rs-private-method-alt.js @@ -0,0 +1,136 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method-alt.case +// - src/class-elements/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Valid PrivateName as private method (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + return this.#$_; + } + #_() { + return this.#__; + } + #\u{6F}() { + return this.#\u{6F}_; + } + #℘() { + return this.#℘_; + } + #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + #ZW_â€_J() { + return this.#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}); + +c.m().then(function(v) { + assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-private-method.js b/test/language/statements/class/fields-same-line-async-method-rs-private-method.js new file mode 100644 index 0000000000000000000000000000000000000000..96f9567aa8497cfb3242a81dc8b0bf8038080f0e --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-rs-private-method.js @@ -0,0 +1,136 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method.case +// - src/class-elements/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Valid PrivateName as private method (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + 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_; + } +; + $(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}); + +c.m().then(function(v) { + assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-private-setter-alt.js b/test/language/statements/class/fields-same-line-async-method-rs-private-setter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..1f0b4210af8a3664f61d8c5041e834295987a05e --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-rs-private-setter-alt.js @@ -0,0 +1,136 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter-alt.case +// - src/class-elements/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Valid PrivateName as private setter (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #℘(value) { + this.#℘_ = value; + } + set #ZW_‌_NJ(value) { + this.#ZW_‌_NJ_ = value; + } + set #ZW_â€_J(value) { + this.#ZW_â€_J_ = value; + } +; + $(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}); + +c.m().then(function(v) { + assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-private-setter.js b/test/language/statements/class/fields-same-line-async-method-rs-private-setter.js new file mode 100644 index 0000000000000000000000000000000000000000..e71d12026425f62a7016b5725e27e2e6e47416e2 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-rs-private-setter.js @@ -0,0 +1,136 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter.case +// - src/class-elements/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Valid PrivateName as private setter (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #\u2118(value) { + this.#\u2118_ = value; + } + set #ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ_ = value; + } + set #ZW_\u200D_J(value) { + this.#ZW_\u200D_J_ = value; + } +; + $(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}); + +c.m().then(function(v) { + assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + 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); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-gen-rs-private-getter-alt.js b/test/language/statements/class/fields-same-line-gen-rs-private-getter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..ff7a4da7cc3aac17a74edc94c56df198f8f167a8 --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-rs-private-getter-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter-alt.case +// - src/class-elements/productions/cls-decl-same-line-generator.template +/*--- +description: Valid PrivateName as private getter (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #℘() { + return this.#℘_; + } + get #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + get #ZW_â€_J() { + return this.#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-private-getter.js b/test/language/statements/class/fields-same-line-gen-rs-private-getter.js new file mode 100644 index 0000000000000000000000000000000000000000..7ece9717cff99023e4c9f3f151fdd27624b1fee2 --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-rs-private-getter.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter.case +// - src/class-elements/productions/cls-decl-same-line-generator.template +/*--- +description: Valid PrivateName as private getter (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #\u2118() { + return this.#\u2118_; + } + get #ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ_; + } + get #ZW_\u200D_J() { + return this.#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-private-method-alt.js b/test/language/statements/class/fields-same-line-gen-rs-private-method-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..498a91ee2edf4fa9d81e6fd536422e4aac16842a --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-rs-private-method-alt.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method-alt.case +// - src/class-elements/productions/cls-decl-same-line-generator.template +/*--- +description: Valid PrivateName as private method (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + return this.#$_; + } + #_() { + return this.#__; + } + #\u{6F}() { + return this.#\u{6F}_; + } + #℘() { + return this.#℘_; + } + #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + #ZW_â€_J() { + return this.#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-private-method.js b/test/language/statements/class/fields-same-line-gen-rs-private-method.js new file mode 100644 index 0000000000000000000000000000000000000000..dc606a98f51b101574f94dfe8723e210c90c8bec --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-rs-private-method.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method.case +// - src/class-elements/productions/cls-decl-same-line-generator.template +/*--- +description: Valid PrivateName as private method (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + 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_; + } +; *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-private-setter-alt.js b/test/language/statements/class/fields-same-line-gen-rs-private-setter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..40befb4a95f7fc6120cc05ad2b0457436e887423 --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-rs-private-setter-alt.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter-alt.case +// - src/class-elements/productions/cls-decl-same-line-generator.template +/*--- +description: Valid PrivateName as private setter (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #℘(value) { + this.#℘_ = value; + } + set #ZW_‌_NJ(value) { + this.#ZW_‌_NJ_ = value; + } + set #ZW_â€_J(value) { + this.#ZW_â€_J_ = value; + } +; *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-private-setter.js b/test/language/statements/class/fields-same-line-gen-rs-private-setter.js new file mode 100644 index 0000000000000000000000000000000000000000..8f6053fdcbb6a2754cc40143f8d687e3a4267dc4 --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-rs-private-setter.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter.case +// - src/class-elements/productions/cls-decl-same-line-generator.template +/*--- +description: Valid PrivateName as private setter (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #\u2118(value) { + this.#\u2118_ = value; + } + set #ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ_ = value; + } + set #ZW_\u200D_J(value) { + this.#ZW_\u200D_J_ = value; + } +; *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-method-rs-private-getter-alt.js b/test/language/statements/class/fields-same-line-method-rs-private-getter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..f62b3af233165b474c800b005f9856fc3301cb92 --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-rs-private-getter-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter-alt.case +// - src/class-elements/productions/cls-decl-same-line-method.template +/*--- +description: Valid PrivateName as private getter (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #℘() { + return this.#℘_; + } + get #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + get #ZW_â€_J() { + return this.#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-private-getter.js b/test/language/statements/class/fields-same-line-method-rs-private-getter.js new file mode 100644 index 0000000000000000000000000000000000000000..554c1c669079b5dd725beb74c549006cf89525e5 --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-rs-private-getter.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter.case +// - src/class-elements/productions/cls-decl-same-line-method.template +/*--- +description: Valid PrivateName as private getter (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #\u2118() { + return this.#\u2118_; + } + get #ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ_; + } + get #ZW_\u200D_J() { + return this.#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-private-method-alt.js b/test/language/statements/class/fields-same-line-method-rs-private-method-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..593d89c2be03c48a9f0cdc7782fbbb4213717e97 --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-rs-private-method-alt.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method-alt.case +// - src/class-elements/productions/cls-decl-same-line-method.template +/*--- +description: Valid PrivateName as private method (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + return this.#$_; + } + #_() { + return this.#__; + } + #\u{6F}() { + return this.#\u{6F}_; + } + #℘() { + return this.#℘_; + } + #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + #ZW_â€_J() { + return this.#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-private-method.js b/test/language/statements/class/fields-same-line-method-rs-private-method.js new file mode 100644 index 0000000000000000000000000000000000000000..ca69c3ef332ae03a31cb596cc23554499ff1de91 --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-rs-private-method.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method.case +// - src/class-elements/productions/cls-decl-same-line-method.template +/*--- +description: Valid PrivateName as private method (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + 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_; + } +; 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-private-setter-alt.js b/test/language/statements/class/fields-same-line-method-rs-private-setter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..4a310a8d7ae3aae5a83ee795b11f828d28776d9b --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-rs-private-setter-alt.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter-alt.case +// - src/class-elements/productions/cls-decl-same-line-method.template +/*--- +description: Valid PrivateName as private setter (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #℘(value) { + this.#℘_ = value; + } + set #ZW_‌_NJ(value) { + this.#ZW_‌_NJ_ = value; + } + set #ZW_â€_J(value) { + this.#ZW_â€_J_ = value; + } +; 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-private-setter.js b/test/language/statements/class/fields-same-line-method-rs-private-setter.js new file mode 100644 index 0000000000000000000000000000000000000000..6e1dd73f13f57541e7246da273213b8aba1f878e --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-rs-private-setter.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter.case +// - src/class-elements/productions/cls-decl-same-line-method.template +/*--- +description: Valid PrivateName as private setter (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #\u2118(value) { + this.#\u2118_ = value; + } + set #ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ_ = value; + } + set #ZW_\u200D_J(value) { + this.#ZW_\u200D_J_ = value; + } +; 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-wrapped-in-sc-rs-private-getter-alt.js b/test/language/statements/class/fields-wrapped-in-sc-rs-private-getter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..48ca7a2d2f0735e61fd71408dd16819388aaf96f --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-private-getter-alt.js @@ -0,0 +1,115 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter-alt.case +// - src/class-elements/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Valid PrivateName as private getter (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #℘() { + return this.#℘_; + } + get #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + get #ZW_â€_J() { + return this.#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-private-getter.js b/test/language/statements/class/fields-wrapped-in-sc-rs-private-getter.js new file mode 100644 index 0000000000000000000000000000000000000000..ba1be89c95313bb955f146a05414f81b89ded912 --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-private-getter.js @@ -0,0 +1,115 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-getter.case +// - src/class-elements/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Valid PrivateName as private getter (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + get ClassElementName ( ){ FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + get #$() { + return this.#$_; + } + get #_() { + return this.#__; + } + get #\u{6F}() { + return this.#\u{6F}_; + } + get #\u2118() { + return this.#\u2118_; + } + get #ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ_; + } + get #ZW_\u200D_J() { + return this.#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-private-method-alt.js b/test/language/statements/class/fields-wrapped-in-sc-rs-private-method-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..8c7a4ad9c8f3f55539f35b4ab9c5ba5965109144 --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-private-method-alt.js @@ -0,0 +1,114 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method-alt.case +// - src/class-elements/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Valid PrivateName as private method (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + return this.#$_; + } + #_() { + return this.#__; + } + #\u{6F}() { + return this.#\u{6F}_; + } + #℘() { + return this.#℘_; + } + #ZW_‌_NJ() { + return this.#ZW_‌_NJ_; + } + #ZW_â€_J() { + return this.#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-private-method.js b/test/language/statements/class/fields-wrapped-in-sc-rs-private-method.js new file mode 100644 index 0000000000000000000000000000000000000000..193487fd20623bd37ea7de4c5ec6a3ed25db4867 --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-private-method.js @@ -0,0 +1,114 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-method.case +// - src/class-elements/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Valid PrivateName as private method (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + ... + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + #$() { + 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_; + } +;;;;;;; + ;;;; + $(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-private-setter-alt.js b/test/language/statements/class/fields-wrapped-in-sc-rs-private-setter-alt.js new file mode 100644 index 0000000000000000000000000000000000000000..6298543d7de927fbdb228dd2a9a1cc8cbe51753b --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-private-setter-alt.js @@ -0,0 +1,114 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter-alt.case +// - src/class-elements/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Valid PrivateName as private setter (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #℘(value) { + this.#℘_ = value; + } + set #ZW_‌_NJ(value) { + this.#ZW_‌_NJ_ = value; + } + set #ZW_â€_J(value) { + this.#ZW_â€_J_ = value; + } +;;;;;;; + ;;;; + $(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-private-setter.js b/test/language/statements/class/fields-wrapped-in-sc-rs-private-setter.js new file mode 100644 index 0000000000000000000000000000000000000000..8005465952dee7da0c2e13850cd27b037f1b3954 --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-private-setter.js @@ -0,0 +1,114 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/rs-private-setter.case +// - src/class-elements/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Valid PrivateName as private setter (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + ... + ; + + MethodDefinition : + ... + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + NOTE 3 + The sets of code 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_; + set #$(value) { + this.#$_ = value; + } + set #_(value) { + this.#__ = value; + } + set #\u{6F}(value) { + this.#\u{6F}_ = value; + } + set #\u2118(value) { + this.#\u2118_ = value; + } + set #ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ_ = value; + } + set #ZW_\u200D_J(value) { + this.#ZW_\u200D_J_ = value; + } +;;;;;;; + ;;;; + $(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);