diff --git a/test/language/expressions/class/fields-after-same-line-gen-private-field-usage.js b/test/language/expressions/class/fields-after-same-line-gen-private-field-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..474292752915dd175423b92fbf98e48db9810912 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-private-field-usage.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-field-usage.case +// - src/class-elements/productions/cls-expr-after-same-line-gen.template +/*--- +description: PrivateName CallExpression usage (private field) (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + *m() { return 42; } #m = 'test262';; + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/expressions/class/fields-after-same-line-gen-private-method-getter-usage.js b/test/language/expressions/class/fields-after-same-line-gen-private-method-getter-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..2ead1b9cc30d8cfda965d4a157fe243bab89abf9 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-private-method-getter-usage.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-getter-usage.case +// - src/class-elements/productions/cls-expr-after-same-line-gen.template +/*--- +description: PrivateName CallExpression usage (Accesor get 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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + *m() { return 42; } get #m() { return 'test262'; }; + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/expressions/class/fields-after-same-line-gen-private-method-usage.js b/test/language/expressions/class/fields-after-same-line-gen-private-method-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..ad5d834630c593194596a23383e5571d7c0a6e03 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-private-method-usage.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-usage.case +// - src/class-elements/productions/cls-expr-after-same-line-gen.template +/*--- +description: PrivateName CallExpression usage (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + *m() { return 42; } #m() { return 'test262'; }; + method() { + return this.#m(); + } +} + +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.method(), 'test262'); diff --git a/test/language/expressions/class/fields-after-same-line-method-private-field-usage.js b/test/language/expressions/class/fields-after-same-line-method-private-field-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..17250a9e45c8d67f5a4780d7aca312a8e2ed4d13 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-private-field-usage.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-field-usage.case +// - src/class-elements/productions/cls-expr-after-same-line-method.template +/*--- +description: PrivateName CallExpression usage (private field) (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + m() { return 42; } #m = 'test262';; + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/expressions/class/fields-after-same-line-method-private-method-getter-usage.js b/test/language/expressions/class/fields-after-same-line-method-private-method-getter-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..a4e00ac7a2ed7ccfc629e9189f857284a624f94d --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-private-method-getter-usage.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-getter-usage.case +// - src/class-elements/productions/cls-expr-after-same-line-method.template +/*--- +description: PrivateName CallExpression usage (Accesor get 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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + m() { return 42; } get #m() { return 'test262'; }; + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/expressions/class/fields-after-same-line-method-private-method-usage.js b/test/language/expressions/class/fields-after-same-line-method-private-method-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..e60547415e596a55b042507d9fa01210464d0ab7 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-private-method-usage.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-usage.case +// - src/class-elements/productions/cls-expr-after-same-line-method.template +/*--- +description: PrivateName CallExpression usage (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + m() { return 42; } #m() { return 'test262'; }; + method() { + return this.#m(); + } +} + +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.method(), 'test262'); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-private-field-usage.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-private-field-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..674c0be5aa1fad64e3fd79f46f192bdfbae43640 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-private-field-usage.js @@ -0,0 +1,58 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-field-usage.case +// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: PrivateName CallExpression usage (private field) (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + static async *m() { return 42; } #m = 'test262';; + method() { + return this.#m; + } +} + +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.method(), 'test262'); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-private-method-getter-usage.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-private-method-getter-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..a7df71df15f5db2fff95f8679aa0c7162c12d072 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-private-method-getter-usage.js @@ -0,0 +1,58 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-getter-usage.case +// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: PrivateName CallExpression usage (Accesor get 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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + static async *m() { return 42; } get #m() { return 'test262'; }; + method() { + return this.#m; + } +} + +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.method(), 'test262'); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-private-method-usage.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-private-method-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..475a97cb92386728c11902f032099ea8de9425da --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-private-method-usage.js @@ -0,0 +1,58 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-usage.case +// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: PrivateName CallExpression usage (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + static async *m() { return 42; } #m() { return 'test262'; }; + method() { + return this.#m(); + } +} + +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.method(), 'test262'); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-private-field-usage.js b/test/language/expressions/class/fields-after-same-line-static-async-method-private-field-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..58ce3febaa360aee37c727ac7331488d96cc666a --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-private-field-usage.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-field-usage.case +// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: PrivateName CallExpression usage (private field) (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + static async m() { return 42; } #m = 'test262';; + method() { + return this.#m; + } +} + +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.method(), 'test262'); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-private-method-getter-usage.js b/test/language/expressions/class/fields-after-same-line-static-async-method-private-method-getter-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..f5cc497556bf61e640884f6d75cfa7be9329af30 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-private-method-getter-usage.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-getter-usage.case +// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: PrivateName CallExpression usage (Accesor get 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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + static async m() { return 42; } get #m() { return 'test262'; }; + method() { + return this.#m; + } +} + +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.method(), 'test262'); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-private-method-usage.js b/test/language/expressions/class/fields-after-same-line-static-async-method-private-method-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..265c7f64c283d32c9f714b6b9f8ac65239d93a60 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-private-method-usage.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-usage.case +// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: PrivateName CallExpression usage (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + static async m() { return 42; } #m() { return 'test262'; }; + method() { + return this.#m(); + } +} + +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.method(), 'test262'); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-private-field-usage.js b/test/language/expressions/class/fields-after-same-line-static-gen-private-field-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..9096df38bb3abcbaf4bf7677987d40359b94b557 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-private-field-usage.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-field-usage.case +// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: PrivateName CallExpression usage (private field) (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + static *m() { return 42; } #m = 'test262';; + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-private-method-getter-usage.js b/test/language/expressions/class/fields-after-same-line-static-gen-private-method-getter-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..14b6edc253d17e39a52a0b7c9de02b4fb16d6dcd --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-private-method-getter-usage.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-getter-usage.case +// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: PrivateName CallExpression usage (Accesor get 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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + static *m() { return 42; } get #m() { return 'test262'; }; + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-private-method-usage.js b/test/language/expressions/class/fields-after-same-line-static-gen-private-method-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..c463f976b80bbd5fdc26bf9d36334bc9300df8ba --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-private-method-usage.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-usage.case +// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: PrivateName CallExpression usage (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + static *m() { return 42; } #m() { return 'test262'; }; + method() { + return this.#m(); + } +} + +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.method(), 'test262'); diff --git a/test/language/expressions/class/fields-after-same-line-static-method-private-field-usage.js b/test/language/expressions/class/fields-after-same-line-static-method-private-field-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..50d87159ada8072589999b5e33d766c0a8829fa0 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-private-field-usage.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-field-usage.case +// - src/class-elements/productions/cls-expr-after-same-line-static-method.template +/*--- +description: PrivateName CallExpression usage (private field) (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + static m() { return 42; } #m = 'test262';; + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/expressions/class/fields-after-same-line-static-method-private-method-getter-usage.js b/test/language/expressions/class/fields-after-same-line-static-method-private-method-getter-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..4138350713cf8d1edbd482fa164835c912e39e85 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-private-method-getter-usage.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-getter-usage.case +// - src/class-elements/productions/cls-expr-after-same-line-static-method.template +/*--- +description: PrivateName CallExpression usage (Accesor get 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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + static m() { return 42; } get #m() { return 'test262'; }; + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/expressions/class/fields-after-same-line-static-method-private-method-usage.js b/test/language/expressions/class/fields-after-same-line-static-method-private-method-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..034d7a6952e6f0f72913ed1da6e83de818edd08a --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-private-method-usage.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-usage.case +// - src/class-elements/productions/cls-expr-after-same-line-static-method.template +/*--- +description: PrivateName CallExpression usage (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + static m() { return 42; } #m() { return 'test262'; }; + method() { + return this.#m(); + } +} + +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.method(), 'test262'); diff --git a/test/language/expressions/class/fields-multiple-definitions-private-field-usage.js b/test/language/expressions/class/fields-multiple-definitions-private-field-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..5ce6c6f8636970e56f281ce1adfa13db3327b5f3 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-private-field-usage.js @@ -0,0 +1,80 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-field-usage.case +// - src/class-elements/productions/cls-expr-multiple-definitions.template +/*--- +description: PrivateName CallExpression usage (private field) (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + #m = 'test262'; + m2() { return 39 } + bar = "barbaz"; + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/expressions/class/fields-multiple-definitions-private-method-getter-usage.js b/test/language/expressions/class/fields-multiple-definitions-private-method-getter-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..ac0363512643aed8f3b8a75ccadcd640380aa085 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-private-method-getter-usage.js @@ -0,0 +1,80 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-getter-usage.case +// - src/class-elements/productions/cls-expr-multiple-definitions.template +/*--- +description: PrivateName CallExpression usage (Accesor get method) (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + get #m() { return 'test262'; } + m2() { return 39 } + bar = "barbaz"; + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/expressions/class/fields-multiple-definitions-private-method-usage.js b/test/language/expressions/class/fields-multiple-definitions-private-method-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..7361c0449309efdc247b1e9a732010d6faf72a07 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-private-method-usage.js @@ -0,0 +1,80 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-usage.case +// - src/class-elements/productions/cls-expr-multiple-definitions.template +/*--- +description: PrivateName CallExpression usage (private method) (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + #m() { return 'test262'; } + m2() { return 39 } + bar = "barbaz"; + method() { + return this.#m(); + } +} + +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.method(), 'test262'); diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-private-field-usage.js b/test/language/expressions/class/fields-multiple-stacked-definitions-private-field-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..0b62a2f913b98bd44711863ad1de8cb849ec9e7c --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-private-field-usage.js @@ -0,0 +1,58 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-field-usage.case +// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: PrivateName CallExpression usage (private field) (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + #m = 'test262'; + foo = "foobar" + bar = "barbaz"; + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-private-method-getter-usage.js b/test/language/expressions/class/fields-multiple-stacked-definitions-private-method-getter-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..cc4803d5d44a1a1e3fbe227388187762e2af3fe0 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-private-method-getter-usage.js @@ -0,0 +1,58 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-getter-usage.case +// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: PrivateName CallExpression usage (Accesor get method) (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + get #m() { return 'test262'; } + foo = "foobar" + bar = "barbaz"; + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-private-method-usage.js b/test/language/expressions/class/fields-multiple-stacked-definitions-private-method-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..f4f7fa08e7ac0796bac15554616fb00f5590a390 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-private-method-usage.js @@ -0,0 +1,58 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-usage.case +// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: PrivateName CallExpression usage (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + #m() { return 'test262'; } + foo = "foobar" + bar = "barbaz"; + method() { + return this.#m(); + } +} + +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.method(), 'test262'); diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-private-field-usage.js b/test/language/expressions/class/fields-new-no-sc-line-method-private-field-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..4ff69dfb410a4081a58fb6bddd4b5b70b1413d2c --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-private-field-usage.js @@ -0,0 +1,45 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-field-usage.case +// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: PrivateName CallExpression usage (private field) (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + #m = 'test262'; + m() { return 42; } + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-private-method-getter-usage.js b/test/language/expressions/class/fields-new-no-sc-line-method-private-method-getter-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..d46583c67fef35e4ad76990224a6787faf32ae85 --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-private-method-getter-usage.js @@ -0,0 +1,45 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-getter-usage.case +// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: PrivateName CallExpression usage (Accesor get 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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + get #m() { return 'test262'; } + m() { return 42; } + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-private-method-usage.js b/test/language/expressions/class/fields-new-no-sc-line-method-private-method-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..45ee29a7d91d04e8470c3ed5dbe1adb07ea86ee0 --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-private-method-usage.js @@ -0,0 +1,45 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-usage.case +// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: PrivateName CallExpression usage (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + #m() { return 'test262'; } + m() { return 42; } + method() { + return this.#m(); + } +} + +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.method(), 'test262'); diff --git a/test/language/expressions/class/fields-new-sc-line-gen-private-field-usage.js b/test/language/expressions/class/fields-new-sc-line-gen-private-field-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..57ee8784d4b2a5a5fc843fedc87bc9a2ee7f3104 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-private-field-usage.js @@ -0,0 +1,45 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-field-usage.case +// - src/class-elements/productions/cls-expr-new-sc-line-generator.template +/*--- +description: PrivateName CallExpression usage (private field) (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + #m = 'test262';; + *m() { return 42; } + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/expressions/class/fields-new-sc-line-gen-private-method-getter-usage.js b/test/language/expressions/class/fields-new-sc-line-gen-private-method-getter-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..a89962a5bcc2fd3c1f221df5be22214aea6931c4 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-private-method-getter-usage.js @@ -0,0 +1,45 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-getter-usage.case +// - src/class-elements/productions/cls-expr-new-sc-line-generator.template +/*--- +description: PrivateName CallExpression usage (Accesor get 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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + get #m() { return 'test262'; }; + *m() { return 42; } + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/expressions/class/fields-new-sc-line-gen-private-method-usage.js b/test/language/expressions/class/fields-new-sc-line-gen-private-method-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..d27918c87d725a76b966768b68b24d100c6a6a69 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-private-method-usage.js @@ -0,0 +1,45 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-usage.case +// - src/class-elements/productions/cls-expr-new-sc-line-generator.template +/*--- +description: PrivateName CallExpression usage (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + #m() { return 'test262'; }; + *m() { return 42; } + method() { + return this.#m(); + } +} + +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.method(), 'test262'); diff --git a/test/language/expressions/class/fields-new-sc-line-method-private-field-usage.js b/test/language/expressions/class/fields-new-sc-line-method-private-field-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..272a6a2f97d7e334d5ab0859db662908e5e0a0c0 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-private-field-usage.js @@ -0,0 +1,45 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-field-usage.case +// - src/class-elements/productions/cls-expr-new-sc-line-method.template +/*--- +description: PrivateName CallExpression usage (private field) (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + #m = 'test262';; + m() { return 42; } + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/expressions/class/fields-new-sc-line-method-private-method-getter-usage.js b/test/language/expressions/class/fields-new-sc-line-method-private-method-getter-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..5f46aa8eb1dc611ffea649f232894ba37ac84671 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-private-method-getter-usage.js @@ -0,0 +1,45 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-getter-usage.case +// - src/class-elements/productions/cls-expr-new-sc-line-method.template +/*--- +description: PrivateName CallExpression usage (Accesor get 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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + get #m() { return 'test262'; }; + m() { return 42; } + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/expressions/class/fields-new-sc-line-method-private-method-usage.js b/test/language/expressions/class/fields-new-sc-line-method-private-method-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..6ab38a019bac6145cf63d1207dfc257e98898b05 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-private-method-usage.js @@ -0,0 +1,45 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-usage.case +// - src/class-elements/productions/cls-expr-new-sc-line-method.template +/*--- +description: PrivateName CallExpression usage (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + #m() { return 'test262'; }; + m() { return 42; } + method() { + return this.#m(); + } +} + +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.method(), 'test262'); diff --git a/test/language/expressions/class/fields-regular-definitions-private-field-usage.js b/test/language/expressions/class/fields-regular-definitions-private-field-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..c4862fa0b87fc2e76515728b95ec22f452e3f617 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-private-field-usage.js @@ -0,0 +1,33 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-field-usage.case +// - src/class-elements/productions/cls-expr-regular-definitions.template +/*--- +description: PrivateName CallExpression usage (private field) (regular fields defintion) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +info: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + #m = 'test262'; + method() { + return this.#m; + } +} + +var c = new C(); + +assert.sameValue(c.method(), 'test262'); diff --git a/test/language/expressions/class/fields-regular-definitions-private-method-getter-usage.js b/test/language/expressions/class/fields-regular-definitions-private-method-getter-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..a4e5f79d2f2977a82577df90565e11e58e0c370d --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-private-method-getter-usage.js @@ -0,0 +1,33 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-getter-usage.case +// - src/class-elements/productions/cls-expr-regular-definitions.template +/*--- +description: PrivateName CallExpression usage (Accesor get method) (regular fields defintion) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +info: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + get #m() { return 'test262'; } + method() { + return this.#m; + } +} + +var c = new C(); + +assert.sameValue(c.method(), 'test262'); diff --git a/test/language/expressions/class/fields-regular-definitions-private-method-usage.js b/test/language/expressions/class/fields-regular-definitions-private-method-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..39de61dc6589becddac37d919f3c1f4bb87c4ad1 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-private-method-usage.js @@ -0,0 +1,33 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-usage.case +// - src/class-elements/productions/cls-expr-regular-definitions.template +/*--- +description: PrivateName CallExpression usage (private method) (regular fields defintion) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +info: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + #m() { return 'test262'; } + method() { + return this.#m(); + } +} + +var c = new C(); + +assert.sameValue(c.method(), 'test262'); diff --git a/test/language/expressions/class/fields-same-line-async-gen-private-field-usage.js b/test/language/expressions/class/fields-same-line-async-gen-private-field-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..f92c14b0b2e30a83556b8aec17fa47436ab870b0 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-private-field-usage.js @@ -0,0 +1,58 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-field-usage.case +// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: PrivateName CallExpression usage (private field) (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + async *m() { return 42; } #m = 'test262';; + method() { + return this.#m; + } +} + +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.method(), 'test262'); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-private-method-getter-usage.js b/test/language/expressions/class/fields-same-line-async-gen-private-method-getter-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..b48d7ea9e88ce3195752c9772b4938fb09726c7d --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-private-method-getter-usage.js @@ -0,0 +1,58 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-getter-usage.case +// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: PrivateName CallExpression usage (Accesor get 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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + async *m() { return 42; } get #m() { return 'test262'; }; + method() { + return this.#m; + } +} + +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.method(), 'test262'); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-private-method-usage.js b/test/language/expressions/class/fields-same-line-async-gen-private-method-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..500391d1b4ce5a15b564b03d7997b30368c68727 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-private-method-usage.js @@ -0,0 +1,58 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-usage.case +// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: PrivateName CallExpression usage (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + async *m() { return 42; } #m() { return 'test262'; }; + method() { + return this.#m(); + } +} + +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.method(), 'test262'); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-private-field-usage.js b/test/language/expressions/class/fields-same-line-async-method-private-field-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..3ed0aa98c2384289fca2c91e269bb04630dc7f05 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-private-field-usage.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-field-usage.case +// - src/class-elements/productions/cls-expr-after-same-line-async-method.template +/*--- +description: PrivateName CallExpression usage (private field) (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + async m() { return 42; } #m = 'test262';; + method() { + return this.#m; + } +} + +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.method(), 'test262'); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-private-method-getter-usage.js b/test/language/expressions/class/fields-same-line-async-method-private-method-getter-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..bb7da05ed965278b99bfde9b9ca8cbb3c933d205 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-private-method-getter-usage.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-getter-usage.case +// - src/class-elements/productions/cls-expr-after-same-line-async-method.template +/*--- +description: PrivateName CallExpression usage (Accesor get 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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + async m() { return 42; } get #m() { return 'test262'; }; + method() { + return this.#m; + } +} + +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.method(), 'test262'); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-private-method-usage.js b/test/language/expressions/class/fields-same-line-async-method-private-method-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..384228b9c47a5b05531e959f2a203dc6dd4f0a3e --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-private-method-usage.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-usage.case +// - src/class-elements/productions/cls-expr-after-same-line-async-method.template +/*--- +description: PrivateName CallExpression usage (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + async m() { return 42; } #m() { return 'test262'; }; + method() { + return this.#m(); + } +} + +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.method(), 'test262'); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-gen-private-field-usage.js b/test/language/expressions/class/fields-same-line-gen-private-field-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..a759c8cd6204c494301ac0f9cc1fcf63b41fb89c --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-private-field-usage.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-field-usage.case +// - src/class-elements/productions/cls-expr-same-line-generator.template +/*--- +description: PrivateName CallExpression usage (private field) (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + #m = 'test262';; *m() { return 42; } + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/expressions/class/fields-same-line-gen-private-method-getter-usage.js b/test/language/expressions/class/fields-same-line-gen-private-method-getter-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..7066d93742989f28514f7c36731696903a2b2198 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-private-method-getter-usage.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-getter-usage.case +// - src/class-elements/productions/cls-expr-same-line-generator.template +/*--- +description: PrivateName CallExpression usage (Accesor get 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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + get #m() { return 'test262'; }; *m() { return 42; } + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/expressions/class/fields-same-line-gen-private-method-usage.js b/test/language/expressions/class/fields-same-line-gen-private-method-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..cd280de1b215e0c4bdd096cc9d751f7ce1090187 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-private-method-usage.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-usage.case +// - src/class-elements/productions/cls-expr-same-line-generator.template +/*--- +description: PrivateName CallExpression usage (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + #m() { return 'test262'; }; *m() { return 42; } + method() { + return this.#m(); + } +} + +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.method(), 'test262'); diff --git a/test/language/expressions/class/fields-same-line-method-private-field-usage.js b/test/language/expressions/class/fields-same-line-method-private-field-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..4b37abf5cc7fecbfeabaf604a10a61e1bd4e1632 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-private-field-usage.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-field-usage.case +// - src/class-elements/productions/cls-expr-same-line-method.template +/*--- +description: PrivateName CallExpression usage (private field) (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + #m = 'test262';; m() { return 42; } + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/expressions/class/fields-same-line-method-private-method-getter-usage.js b/test/language/expressions/class/fields-same-line-method-private-method-getter-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..7b881f662d7f317c43a50d9de8fe6cf682b047dc --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-private-method-getter-usage.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-getter-usage.case +// - src/class-elements/productions/cls-expr-same-line-method.template +/*--- +description: PrivateName CallExpression usage (Accesor get 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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + get #m() { return 'test262'; }; m() { return 42; } + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/expressions/class/fields-same-line-method-private-method-usage.js b/test/language/expressions/class/fields-same-line-method-private-method-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..d191c1c202153964e71bfa3dcdb1af6712590f32 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-private-method-usage.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-usage.case +// - src/class-elements/productions/cls-expr-same-line-method.template +/*--- +description: PrivateName CallExpression usage (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + #m() { return 'test262'; }; m() { return 42; } + method() { + return this.#m(); + } +} + +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.method(), 'test262'); diff --git a/test/language/expressions/class/fields-wrapped-in-sc-private-field-usage.js b/test/language/expressions/class/fields-wrapped-in-sc-private-field-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..db915bfc1fc223e850acbac1e743568555418054 --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-private-field-usage.js @@ -0,0 +1,35 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-field-usage.case +// - src/class-elements/productions/cls-expr-wrapped-in-sc.template +/*--- +description: PrivateName CallExpression usage (private field) (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +info: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + ;;;; + ;;;;;;#m = 'test262';;;;;;;; + ;;;; + method() { + return this.#m; + } +} + +var c = new C(); + +assert.sameValue(c.method(), 'test262'); diff --git a/test/language/expressions/class/fields-wrapped-in-sc-private-method-getter-usage.js b/test/language/expressions/class/fields-wrapped-in-sc-private-method-getter-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..a00e4e4a2de4d3d25a2a45765605d183c2819b0d --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-private-method-getter-usage.js @@ -0,0 +1,35 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-getter-usage.case +// - src/class-elements/productions/cls-expr-wrapped-in-sc.template +/*--- +description: PrivateName CallExpression usage (Accesor get method) (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +info: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + ;;;; + ;;;;;;get #m() { return 'test262'; };;;;;;; + ;;;; + method() { + return this.#m; + } +} + +var c = new C(); + +assert.sameValue(c.method(), 'test262'); diff --git a/test/language/expressions/class/fields-wrapped-in-sc-private-method-usage.js b/test/language/expressions/class/fields-wrapped-in-sc-private-method-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..4e7f6808450cb461f654c9a9ac7a599cb8c3c9fc --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-private-method-usage.js @@ -0,0 +1,35 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-usage.case +// - src/class-elements/productions/cls-expr-wrapped-in-sc.template +/*--- +description: PrivateName CallExpression usage (private method) (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +info: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +var C = class { + ;;;; + ;;;;;;#m() { return 'test262'; };;;;;;; + ;;;; + method() { + return this.#m(); + } +} + +var c = new C(); + +assert.sameValue(c.method(), 'test262'); diff --git a/test/language/statements/class/fields-after-same-line-gen-private-field-usage.js b/test/language/statements/class/fields-after-same-line-gen-private-field-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..e708f8e5abdbf1f81f67514bece06ff405c6a59a --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-private-field-usage.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-field-usage.case +// - src/class-elements/productions/cls-decl-after-same-line-gen.template +/*--- +description: PrivateName CallExpression usage (private field) (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + *m() { return 42; } #m = 'test262';; + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/statements/class/fields-after-same-line-gen-private-method-getter-usage.js b/test/language/statements/class/fields-after-same-line-gen-private-method-getter-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..85cab8b982bf0f4b987c13e61b5fb297699cd236 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-private-method-getter-usage.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-getter-usage.case +// - src/class-elements/productions/cls-decl-after-same-line-gen.template +/*--- +description: PrivateName CallExpression usage (Accesor get 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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + *m() { return 42; } get #m() { return 'test262'; }; + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/statements/class/fields-after-same-line-gen-private-method-usage.js b/test/language/statements/class/fields-after-same-line-gen-private-method-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..3a33efb76392fe6dcd30d0578e1c489cfb99ea0f --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-private-method-usage.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-usage.case +// - src/class-elements/productions/cls-decl-after-same-line-gen.template +/*--- +description: PrivateName CallExpression usage (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + *m() { return 42; } #m() { return 'test262'; }; + method() { + return this.#m(); + } +} + +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.method(), 'test262'); diff --git a/test/language/statements/class/fields-after-same-line-method-private-field-usage.js b/test/language/statements/class/fields-after-same-line-method-private-field-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..d9bf5c5e450b7f43cc2c2316638c645a1acdc0e3 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-private-field-usage.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-field-usage.case +// - src/class-elements/productions/cls-decl-after-same-line-method.template +/*--- +description: PrivateName CallExpression usage (private field) (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + m() { return 42; } #m = 'test262';; + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/statements/class/fields-after-same-line-method-private-method-getter-usage.js b/test/language/statements/class/fields-after-same-line-method-private-method-getter-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..e9582f50f8acae3a87cfd11bd9c1df076b9e55b8 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-private-method-getter-usage.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-getter-usage.case +// - src/class-elements/productions/cls-decl-after-same-line-method.template +/*--- +description: PrivateName CallExpression usage (Accesor get 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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + m() { return 42; } get #m() { return 'test262'; }; + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/statements/class/fields-after-same-line-method-private-method-usage.js b/test/language/statements/class/fields-after-same-line-method-private-method-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..85544cd901dc5977dca28ac00685d2b39d90c97c --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-private-method-usage.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-usage.case +// - src/class-elements/productions/cls-decl-after-same-line-method.template +/*--- +description: PrivateName CallExpression usage (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + m() { return 42; } #m() { return 'test262'; }; + method() { + return this.#m(); + } +} + +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.method(), 'test262'); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-private-field-usage.js b/test/language/statements/class/fields-after-same-line-static-async-gen-private-field-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..6f6f5bead3c087f0a08425196d6a990776ab582c --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-private-field-usage.js @@ -0,0 +1,58 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-field-usage.case +// - src/class-elements/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: PrivateName CallExpression usage (private field) (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + static async *m() { return 42; } #m = 'test262';; + method() { + return this.#m; + } +} + +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.method(), 'test262'); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-private-method-getter-usage.js b/test/language/statements/class/fields-after-same-line-static-async-gen-private-method-getter-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..714b52ada41bf4451647cf8af6a81c58d47cd777 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-private-method-getter-usage.js @@ -0,0 +1,58 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-getter-usage.case +// - src/class-elements/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: PrivateName CallExpression usage (Accesor get 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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + static async *m() { return 42; } get #m() { return 'test262'; }; + method() { + return this.#m; + } +} + +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.method(), 'test262'); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-private-method-usage.js b/test/language/statements/class/fields-after-same-line-static-async-gen-private-method-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..ece0a9c4f36a454a814b4a704c389546852866c8 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-private-method-usage.js @@ -0,0 +1,58 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-usage.case +// - src/class-elements/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: PrivateName CallExpression usage (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + static async *m() { return 42; } #m() { return 'test262'; }; + method() { + return this.#m(); + } +} + +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.method(), 'test262'); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-private-field-usage.js b/test/language/statements/class/fields-after-same-line-static-async-method-private-field-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..caff21d030568321bf9c4aad7ee7718294a58dfc --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-private-field-usage.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-field-usage.case +// - src/class-elements/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: PrivateName CallExpression usage (private field) (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + static async m() { return 42; } #m = 'test262';; + method() { + return this.#m; + } +} + +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.method(), 'test262'); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-private-method-getter-usage.js b/test/language/statements/class/fields-after-same-line-static-async-method-private-method-getter-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..3539344904c1bf59ccb284cfb99fa7c09efa2002 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-private-method-getter-usage.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-getter-usage.case +// - src/class-elements/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: PrivateName CallExpression usage (Accesor get 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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + static async m() { return 42; } get #m() { return 'test262'; }; + method() { + return this.#m; + } +} + +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.method(), 'test262'); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-private-method-usage.js b/test/language/statements/class/fields-after-same-line-static-async-method-private-method-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..775137afc46399d36a50b34b405db62f6031aaa4 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-private-method-usage.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-usage.case +// - src/class-elements/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: PrivateName CallExpression usage (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + static async m() { return 42; } #m() { return 'test262'; }; + method() { + return this.#m(); + } +} + +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.method(), 'test262'); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-gen-private-field-usage.js b/test/language/statements/class/fields-after-same-line-static-gen-private-field-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..509fdf5cc22486d8305e1ed80a7704e327b92b05 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-private-field-usage.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-field-usage.case +// - src/class-elements/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: PrivateName CallExpression usage (private field) (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + static *m() { return 42; } #m = 'test262';; + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/statements/class/fields-after-same-line-static-gen-private-method-getter-usage.js b/test/language/statements/class/fields-after-same-line-static-gen-private-method-getter-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..6b36c0acb03dd43f7c8b8827e879ddec109b0890 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-private-method-getter-usage.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-getter-usage.case +// - src/class-elements/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: PrivateName CallExpression usage (Accesor get 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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + static *m() { return 42; } get #m() { return 'test262'; }; + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/statements/class/fields-after-same-line-static-gen-private-method-usage.js b/test/language/statements/class/fields-after-same-line-static-gen-private-method-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..be5f38c9d8bcdb5083030d538b3858ee013d8ead --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-private-method-usage.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-usage.case +// - src/class-elements/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: PrivateName CallExpression usage (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + static *m() { return 42; } #m() { return 'test262'; }; + method() { + return this.#m(); + } +} + +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.method(), 'test262'); diff --git a/test/language/statements/class/fields-after-same-line-static-method-private-field-usage.js b/test/language/statements/class/fields-after-same-line-static-method-private-field-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..2c3c302b881c8846d0562ca38deecc9fb1f6fb9e --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-private-field-usage.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-field-usage.case +// - src/class-elements/productions/cls-decl-after-same-line-static-method.template +/*--- +description: PrivateName CallExpression usage (private field) (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + static m() { return 42; } #m = 'test262';; + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/statements/class/fields-after-same-line-static-method-private-method-getter-usage.js b/test/language/statements/class/fields-after-same-line-static-method-private-method-getter-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..dc7b8781710c12cffd5c1b7ccb9e36b111e1d04c --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-private-method-getter-usage.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-getter-usage.case +// - src/class-elements/productions/cls-decl-after-same-line-static-method.template +/*--- +description: PrivateName CallExpression usage (Accesor get 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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + static m() { return 42; } get #m() { return 'test262'; }; + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/statements/class/fields-after-same-line-static-method-private-method-usage.js b/test/language/statements/class/fields-after-same-line-static-method-private-method-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..77e87bc92ead8729a0a645272bf881eacf1692f7 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-private-method-usage.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-usage.case +// - src/class-elements/productions/cls-decl-after-same-line-static-method.template +/*--- +description: PrivateName CallExpression usage (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + static m() { return 42; } #m() { return 'test262'; }; + method() { + return this.#m(); + } +} + +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.method(), 'test262'); diff --git a/test/language/statements/class/fields-multiple-definitions-private-field-usage.js b/test/language/statements/class/fields-multiple-definitions-private-field-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..1b5c3c5ef0c040abfd7b0a052b0d527ee59ac6b8 --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-private-field-usage.js @@ -0,0 +1,80 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-field-usage.case +// - src/class-elements/productions/cls-decl-multiple-definitions.template +/*--- +description: PrivateName CallExpression usage (private field) (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + foo = "foobar"; + m() { return 42 } + #m = 'test262'; + m2() { return 39 } + bar = "barbaz"; + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/statements/class/fields-multiple-definitions-private-method-getter-usage.js b/test/language/statements/class/fields-multiple-definitions-private-method-getter-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..5d54af16c923d4182a1602390e7f1c680dfe709a --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-private-method-getter-usage.js @@ -0,0 +1,80 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-getter-usage.case +// - src/class-elements/productions/cls-decl-multiple-definitions.template +/*--- +description: PrivateName CallExpression usage (Accesor get method) (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + foo = "foobar"; + m() { return 42 } + get #m() { return 'test262'; } + m2() { return 39 } + bar = "barbaz"; + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/statements/class/fields-multiple-definitions-private-method-usage.js b/test/language/statements/class/fields-multiple-definitions-private-method-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..5a8d9b3c857e019ef16780c36f449416eb9033cf --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-private-method-usage.js @@ -0,0 +1,80 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-usage.case +// - src/class-elements/productions/cls-decl-multiple-definitions.template +/*--- +description: PrivateName CallExpression usage (private method) (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + foo = "foobar"; + m() { return 42 } + #m() { return 'test262'; } + m2() { return 39 } + bar = "barbaz"; + method() { + return this.#m(); + } +} + +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.method(), 'test262'); diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-private-field-usage.js b/test/language/statements/class/fields-multiple-stacked-definitions-private-field-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..0780f2eefbb6936e18cc11a561639815fd3872f5 --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-private-field-usage.js @@ -0,0 +1,58 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-field-usage.case +// - src/class-elements/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: PrivateName CallExpression usage (private field) (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + #m = 'test262'; + foo = "foobar" + bar = "barbaz"; + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-private-method-getter-usage.js b/test/language/statements/class/fields-multiple-stacked-definitions-private-method-getter-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..f28fbe327b3b2567f87139ffd02a1cc2481712e5 --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-private-method-getter-usage.js @@ -0,0 +1,58 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-getter-usage.case +// - src/class-elements/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: PrivateName CallExpression usage (Accesor get method) (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + get #m() { return 'test262'; } + foo = "foobar" + bar = "barbaz"; + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-private-method-usage.js b/test/language/statements/class/fields-multiple-stacked-definitions-private-method-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..bb45bff6dbedad300430e4c88a9dfb01358ab0e5 --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-private-method-usage.js @@ -0,0 +1,58 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-usage.case +// - src/class-elements/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: PrivateName CallExpression usage (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + #m() { return 'test262'; } + foo = "foobar" + bar = "barbaz"; + method() { + return this.#m(); + } +} + +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.method(), 'test262'); diff --git a/test/language/statements/class/fields-new-no-sc-line-method-private-field-usage.js b/test/language/statements/class/fields-new-no-sc-line-method-private-field-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..07721acc0a66b2ab76799a3ddba7413ca1cf3e65 --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-private-field-usage.js @@ -0,0 +1,45 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-field-usage.case +// - src/class-elements/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: PrivateName CallExpression usage (private field) (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + #m = 'test262'; + m() { return 42; } + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/statements/class/fields-new-no-sc-line-method-private-method-getter-usage.js b/test/language/statements/class/fields-new-no-sc-line-method-private-method-getter-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..06262bff41aa5cd47cc81e2741d526a7e05ccaf7 --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-private-method-getter-usage.js @@ -0,0 +1,45 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-getter-usage.case +// - src/class-elements/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: PrivateName CallExpression usage (Accesor get 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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + get #m() { return 'test262'; } + m() { return 42; } + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/statements/class/fields-new-no-sc-line-method-private-method-usage.js b/test/language/statements/class/fields-new-no-sc-line-method-private-method-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..4f0d61f10940a3dd89a878b3de64f1f37ae88c7f --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-private-method-usage.js @@ -0,0 +1,45 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-usage.case +// - src/class-elements/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: PrivateName CallExpression usage (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + #m() { return 'test262'; } + m() { return 42; } + method() { + return this.#m(); + } +} + +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.method(), 'test262'); diff --git a/test/language/statements/class/fields-new-sc-line-gen-private-field-usage.js b/test/language/statements/class/fields-new-sc-line-gen-private-field-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..31cfb364c7a533259dd6a3f08b42d8eeeca72520 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-private-field-usage.js @@ -0,0 +1,45 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-field-usage.case +// - src/class-elements/productions/cls-decl-new-sc-line-generator.template +/*--- +description: PrivateName CallExpression usage (private field) (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + #m = 'test262';; + *m() { return 42; } + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/statements/class/fields-new-sc-line-gen-private-method-getter-usage.js b/test/language/statements/class/fields-new-sc-line-gen-private-method-getter-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..298fedbbbbdac749b57186d02e5b122f8b3c06eb --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-private-method-getter-usage.js @@ -0,0 +1,45 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-getter-usage.case +// - src/class-elements/productions/cls-decl-new-sc-line-generator.template +/*--- +description: PrivateName CallExpression usage (Accesor get 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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + get #m() { return 'test262'; }; + *m() { return 42; } + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/statements/class/fields-new-sc-line-gen-private-method-usage.js b/test/language/statements/class/fields-new-sc-line-gen-private-method-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..113c872428f56353a6d18be7ac8120379ec43da5 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-private-method-usage.js @@ -0,0 +1,45 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-usage.case +// - src/class-elements/productions/cls-decl-new-sc-line-generator.template +/*--- +description: PrivateName CallExpression usage (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + #m() { return 'test262'; }; + *m() { return 42; } + method() { + return this.#m(); + } +} + +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.method(), 'test262'); diff --git a/test/language/statements/class/fields-new-sc-line-method-private-field-usage.js b/test/language/statements/class/fields-new-sc-line-method-private-field-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..187d73a77fde83a1bb6f0f2e2d06596d5e6c35fe --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-private-field-usage.js @@ -0,0 +1,45 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-field-usage.case +// - src/class-elements/productions/cls-decl-new-sc-line-method.template +/*--- +description: PrivateName CallExpression usage (private field) (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + #m = 'test262';; + m() { return 42; } + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/statements/class/fields-new-sc-line-method-private-method-getter-usage.js b/test/language/statements/class/fields-new-sc-line-method-private-method-getter-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..5205cb4884317beee4eb9b0362b2e293ec813446 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-private-method-getter-usage.js @@ -0,0 +1,45 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-getter-usage.case +// - src/class-elements/productions/cls-decl-new-sc-line-method.template +/*--- +description: PrivateName CallExpression usage (Accesor get 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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + get #m() { return 'test262'; }; + m() { return 42; } + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/statements/class/fields-new-sc-line-method-private-method-usage.js b/test/language/statements/class/fields-new-sc-line-method-private-method-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..3a81e315d6c375347f9ce6a5c6338f2940185ec6 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-private-method-usage.js @@ -0,0 +1,45 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-usage.case +// - src/class-elements/productions/cls-decl-new-sc-line-method.template +/*--- +description: PrivateName CallExpression usage (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + #m() { return 'test262'; }; + m() { return 42; } + method() { + return this.#m(); + } +} + +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.method(), 'test262'); diff --git a/test/language/statements/class/fields-regular-definitions-private-field-usage.js b/test/language/statements/class/fields-regular-definitions-private-field-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..56090a9ce12e363e353b4945f8b37799359535f3 --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-private-field-usage.js @@ -0,0 +1,33 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-field-usage.case +// - src/class-elements/productions/cls-decl-regular-definitions.template +/*--- +description: PrivateName CallExpression usage (private field) (regular fields defintion) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +info: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + #m = 'test262'; + method() { + return this.#m; + } +} + +var c = new C(); + +assert.sameValue(c.method(), 'test262'); diff --git a/test/language/statements/class/fields-regular-definitions-private-method-getter-usage.js b/test/language/statements/class/fields-regular-definitions-private-method-getter-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..ed1c2a3710a5cd245b0816a7a0eaaa01a2f8471b --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-private-method-getter-usage.js @@ -0,0 +1,33 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-getter-usage.case +// - src/class-elements/productions/cls-decl-regular-definitions.template +/*--- +description: PrivateName CallExpression usage (Accesor get method) (regular fields defintion) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +info: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + get #m() { return 'test262'; } + method() { + return this.#m; + } +} + +var c = new C(); + +assert.sameValue(c.method(), 'test262'); diff --git a/test/language/statements/class/fields-regular-definitions-private-method-usage.js b/test/language/statements/class/fields-regular-definitions-private-method-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..4d73110485381c0f0abf22d10e7c1756afa4fb4e --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-private-method-usage.js @@ -0,0 +1,33 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-usage.case +// - src/class-elements/productions/cls-decl-regular-definitions.template +/*--- +description: PrivateName CallExpression usage (private method) (regular fields defintion) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +info: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + #m() { return 'test262'; } + method() { + return this.#m(); + } +} + +var c = new C(); + +assert.sameValue(c.method(), 'test262'); diff --git a/test/language/statements/class/fields-same-line-async-gen-private-field-usage.js b/test/language/statements/class/fields-same-line-async-gen-private-field-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..2beb41b7051c3517ee9eb50f43d008a048e229b5 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-private-field-usage.js @@ -0,0 +1,58 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-field-usage.case +// - src/class-elements/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: PrivateName CallExpression usage (private field) (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + async *m() { return 42; } #m = 'test262';; + method() { + return this.#m; + } +} + +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.method(), 'test262'); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-private-method-getter-usage.js b/test/language/statements/class/fields-same-line-async-gen-private-method-getter-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..10b4a2a8e57215d51d2e585d7f3b893afb9db530 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-private-method-getter-usage.js @@ -0,0 +1,58 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-getter-usage.case +// - src/class-elements/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: PrivateName CallExpression usage (Accesor get 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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + async *m() { return 42; } get #m() { return 'test262'; }; + method() { + return this.#m; + } +} + +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.method(), 'test262'); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-private-method-usage.js b/test/language/statements/class/fields-same-line-async-gen-private-method-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..84afd6b90cfe45803764a96d89635c57bf114384 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-private-method-usage.js @@ -0,0 +1,58 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-usage.case +// - src/class-elements/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: PrivateName CallExpression usage (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + async *m() { return 42; } #m() { return 'test262'; }; + method() { + return this.#m(); + } +} + +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.method(), 'test262'); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-private-field-usage.js b/test/language/statements/class/fields-same-line-async-method-private-field-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..6ed26ae663f5efb24fd98a4e29985a4b46974ae5 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-private-field-usage.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-field-usage.case +// - src/class-elements/productions/cls-decl-after-same-line-async-method.template +/*--- +description: PrivateName CallExpression usage (private field) (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + async m() { return 42; } #m = 'test262';; + method() { + return this.#m; + } +} + +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.method(), 'test262'); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-private-method-getter-usage.js b/test/language/statements/class/fields-same-line-async-method-private-method-getter-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..99888641beaab99651fe4cd3809d7d7e3a0561c5 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-private-method-getter-usage.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-getter-usage.case +// - src/class-elements/productions/cls-decl-after-same-line-async-method.template +/*--- +description: PrivateName CallExpression usage (Accesor get 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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + async m() { return 42; } get #m() { return 'test262'; }; + method() { + return this.#m; + } +} + +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.method(), 'test262'); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-private-method-usage.js b/test/language/statements/class/fields-same-line-async-method-private-method-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..36efc7daf3326a7d88498d306cbe78b50ac45145 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-private-method-usage.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-usage.case +// - src/class-elements/productions/cls-decl-after-same-line-async-method.template +/*--- +description: PrivateName CallExpression usage (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + async m() { return 42; } #m() { return 'test262'; }; + method() { + return this.#m(); + } +} + +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.method(), 'test262'); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-gen-private-field-usage.js b/test/language/statements/class/fields-same-line-gen-private-field-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..59ce403db3325a8844542616aef0c56a2ba34a66 --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-private-field-usage.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-field-usage.case +// - src/class-elements/productions/cls-decl-same-line-generator.template +/*--- +description: PrivateName CallExpression usage (private field) (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + #m = 'test262';; *m() { return 42; } + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/statements/class/fields-same-line-gen-private-method-getter-usage.js b/test/language/statements/class/fields-same-line-gen-private-method-getter-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..e9c8ccbe39087cc5fb695ede564c73237673e861 --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-private-method-getter-usage.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-getter-usage.case +// - src/class-elements/productions/cls-decl-same-line-generator.template +/*--- +description: PrivateName CallExpression usage (Accesor get 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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + get #m() { return 'test262'; }; *m() { return 42; } + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/statements/class/fields-same-line-gen-private-method-usage.js b/test/language/statements/class/fields-same-line-gen-private-method-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..4d8429cbf27e77a02c2771a1dc97a19741f0ca0a --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-private-method-usage.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-usage.case +// - src/class-elements/productions/cls-decl-same-line-generator.template +/*--- +description: PrivateName CallExpression usage (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + #m() { return 'test262'; }; *m() { return 42; } + method() { + return this.#m(); + } +} + +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.method(), 'test262'); diff --git a/test/language/statements/class/fields-same-line-method-private-field-usage.js b/test/language/statements/class/fields-same-line-method-private-field-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..7c5bf424676ba10616323ee4e15022f67ebbcdf9 --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-private-field-usage.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-field-usage.case +// - src/class-elements/productions/cls-decl-same-line-method.template +/*--- +description: PrivateName CallExpression usage (private field) (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + #m = 'test262';; m() { return 42; } + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/statements/class/fields-same-line-method-private-method-getter-usage.js b/test/language/statements/class/fields-same-line-method-private-method-getter-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..fbf8eb4063f5c3fa1bd0aec5504f6380d98abf83 --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-private-method-getter-usage.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-getter-usage.case +// - src/class-elements/productions/cls-decl-same-line-method.template +/*--- +description: PrivateName CallExpression usage (Accesor get 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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + get #m() { return 'test262'; }; m() { return 42; } + method() { + return this.#m; + } +} + +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.method(), 'test262'); diff --git a/test/language/statements/class/fields-same-line-method-private-method-usage.js b/test/language/statements/class/fields-same-line-method-private-method-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..2eb883d8d31393d85fa43d1bfe29f2081e2e9b6c --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-private-method-usage.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-usage.case +// - src/class-elements/productions/cls-decl-same-line-method.template +/*--- +description: PrivateName CallExpression usage (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: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + #m() { return 'test262'; }; m() { return 42; } + method() { + return this.#m(); + } +} + +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.method(), 'test262'); diff --git a/test/language/statements/class/fields-wrapped-in-sc-private-field-usage.js b/test/language/statements/class/fields-wrapped-in-sc-private-field-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..aeee9ba5320e65e8cddd648892c33afee5bc69c6 --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-private-field-usage.js @@ -0,0 +1,35 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-field-usage.case +// - src/class-elements/productions/cls-decl-wrapped-in-sc.template +/*--- +description: PrivateName CallExpression usage (private field) (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +info: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + ;;;; + ;;;;;;#m = 'test262';;;;;;;; + ;;;; + method() { + return this.#m; + } +} + +var c = new C(); + +assert.sameValue(c.method(), 'test262'); diff --git a/test/language/statements/class/fields-wrapped-in-sc-private-method-getter-usage.js b/test/language/statements/class/fields-wrapped-in-sc-private-method-getter-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..7b522c420b5026f71a3f06e488fa870a7e545bf6 --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-private-method-getter-usage.js @@ -0,0 +1,35 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-getter-usage.case +// - src/class-elements/productions/cls-decl-wrapped-in-sc.template +/*--- +description: PrivateName CallExpression usage (Accesor get method) (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +info: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + ;;;; + ;;;;;;get #m() { return 'test262'; };;;;;;; + ;;;; + method() { + return this.#m; + } +} + +var c = new C(); + +assert.sameValue(c.method(), 'test262'); diff --git a/test/language/statements/class/fields-wrapped-in-sc-private-method-usage.js b/test/language/statements/class/fields-wrapped-in-sc-private-method-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..f003b1db45eb0c0ac5d9d03ee1148360d5c5b49e --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-private-method-usage.js @@ -0,0 +1,35 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-usage.case +// - src/class-elements/productions/cls-decl-wrapped-in-sc.template +/*--- +description: PrivateName CallExpression usage (private method) (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-methods-private, class, class-fields-public] +flags: [generated] +info: | + Updated Productions + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await] + CallExpression[?Yield, ?Await].PrivateName + +---*/ + + +class C { + ;;;; + ;;;;;;#m() { return 'test262'; };;;;;;; + ;;;; + method() { + return this.#m(); + } +} + +var c = new C(); + +assert.sameValue(c.method(), 'test262');