From 96809308fda91f2810e93dddc6f1b0cb4544ce36 Mon Sep 17 00:00:00 2001 From: Leo Balter Date: Mon, 20 Aug 2018 13:33:58 -0400 Subject: [PATCH] Generate tests --- ...s-after-same-line-gen-literal-names-asi.js | 60 ++++++++++++ ...fter-same-line-method-literal-names-asi.js | 60 ++++++++++++ ...line-static-async-gen-literal-names-asi.js | 74 ++++++++++++++ ...e-static-async-method-literal-names-asi.js | 73 ++++++++++++++ ...-same-line-static-gen-literal-names-asi.js | 60 ++++++++++++ ...me-line-static-method-literal-names-asi.js | 60 ++++++++++++ ...-multiple-definitions-literal-names-asi.js | 96 +++++++++++++++++++ ...e-stacked-definitions-literal-names-asi.js | 74 ++++++++++++++ ...new-no-sc-line-method-literal-names-asi.js | 61 ++++++++++++ ...ields-new-sc-line-gen-literal-names-asi.js | 61 ++++++++++++ ...ds-new-sc-line-method-literal-names-asi.js | 61 ++++++++++++ ...s-regular-definitions-literal-names-asi.js | 50 ++++++++++ ...s-same-line-async-gen-literal-names-asi.js | 74 ++++++++++++++ ...ame-line-async-method-literal-names-asi.js | 73 ++++++++++++++ .../fields-same-line-gen-literal-names-asi.js | 60 ++++++++++++ ...elds-same-line-method-literal-names-asi.js | 60 ++++++++++++ .../fields-wrapped-in-sc-literal-names-asi.js | 52 ++++++++++ ...r-field-def-has-initializer-no-sc-error.js | 35 ------- ...s-after-same-line-gen-literal-names-asi.js | 60 ++++++++++++ ...fter-same-line-method-literal-names-asi.js | 60 ++++++++++++ ...line-static-async-gen-literal-names-asi.js | 74 ++++++++++++++ ...e-static-async-method-literal-names-asi.js | 73 ++++++++++++++ ...-same-line-static-gen-literal-names-asi.js | 60 ++++++++++++ ...me-line-static-method-literal-names-asi.js | 60 ++++++++++++ ...-multiple-definitions-literal-names-asi.js | 96 +++++++++++++++++++ ...e-stacked-definitions-literal-names-asi.js | 74 ++++++++++++++ ...new-no-sc-line-method-literal-names-asi.js | 61 ++++++++++++ ...ields-new-sc-line-gen-literal-names-asi.js | 61 ++++++++++++ ...ds-new-sc-line-method-literal-names-asi.js | 61 ++++++++++++ ...s-regular-definitions-literal-names-asi.js | 50 ++++++++++ ...s-same-line-async-gen-literal-names-asi.js | 74 ++++++++++++++ ...ame-line-async-method-literal-names-asi.js | 73 ++++++++++++++ .../fields-same-line-gen-literal-names-asi.js | 60 ++++++++++++ ...elds-same-line-method-literal-names-asi.js | 60 ++++++++++++ .../fields-wrapped-in-sc-literal-names-asi.js | 52 ++++++++++ ...r-field-def-has-initializer-no-sc-error.js | 35 ------- 36 files changed, 2218 insertions(+), 70 deletions(-) create mode 100644 test/language/expressions/class/fields-after-same-line-gen-literal-names-asi.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-literal-names-asi.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-literal-names-asi.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-literal-names-asi.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-literal-names-asi.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-literal-names-asi.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-literal-names-asi.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-literal-names-asi.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-literal-names-asi.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-literal-names-asi.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-literal-names-asi.js create mode 100644 test/language/expressions/class/fields-regular-definitions-literal-names-asi.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-literal-names-asi.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-literal-names-asi.js create mode 100644 test/language/expressions/class/fields-same-line-gen-literal-names-asi.js create mode 100644 test/language/expressions/class/fields-same-line-method-literal-names-asi.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-literal-names-asi.js delete mode 100644 test/language/expressions/class/syntax-invalid-grammar-field-def-has-initializer-no-sc-error.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-literal-names-asi.js create mode 100644 test/language/statements/class/fields-after-same-line-method-literal-names-asi.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-literal-names-asi.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-literal-names-asi.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-literal-names-asi.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-literal-names-asi.js create mode 100644 test/language/statements/class/fields-multiple-definitions-literal-names-asi.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-literal-names-asi.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-literal-names-asi.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-literal-names-asi.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-literal-names-asi.js create mode 100644 test/language/statements/class/fields-regular-definitions-literal-names-asi.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-literal-names-asi.js create mode 100644 test/language/statements/class/fields-same-line-async-method-literal-names-asi.js create mode 100644 test/language/statements/class/fields-same-line-gen-literal-names-asi.js create mode 100644 test/language/statements/class/fields-same-line-method-literal-names-asi.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-literal-names-asi.js delete mode 100644 test/language/statements/class/syntax-invalid-grammar-field-def-has-initializer-no-sc-error.js diff --git a/test/language/expressions/class/fields-after-same-line-gen-literal-names-asi.js b/test/language/expressions/class/fields-after-same-line-gen-literal-names-asi.js new file mode 100644 index 0000000000..07d3594394 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-literal-names-asi.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-expr-after-same-line-gen.template +/*--- +description: Literal property names with ASI (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + *m() { return 42; } a + b = 42;; + +} + +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(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/fields-after-same-line-method-literal-names-asi.js b/test/language/expressions/class/fields-after-same-line-method-literal-names-asi.js new file mode 100644 index 0000000000..eef03956a0 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-literal-names-asi.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-expr-after-same-line-method.template +/*--- +description: Literal property names with ASI (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + m() { return 42; } a + b = 42;; + +} + +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(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-literal-names-asi.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-literal-names-asi.js new file mode 100644 index 0000000000..a387bee8cc --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-literal-names-asi.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Literal property names with ASI (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + static async *m() { return 42; } a + b = 42;; + +} + +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(Object.hasOwnProperty.call(C.prototype, "a"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + + verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + + verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-literal-names-asi.js b/test/language/expressions/class/fields-after-same-line-static-async-method-literal-names-asi.js new file mode 100644 index 0000000000..05fe894bf2 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-literal-names-asi.js @@ -0,0 +1,73 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Literal property names with ASI (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + static async m() { return 42; } a + b = 42;; + +} + +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(Object.hasOwnProperty.call(C.prototype, "a"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + + verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + + verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-literal-names-asi.js b/test/language/expressions/class/fields-after-same-line-static-gen-literal-names-asi.js new file mode 100644 index 0000000000..3a469c562a --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-literal-names-asi.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Literal property names with ASI (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + static *m() { return 42; } a + b = 42;; + +} + +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(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/fields-after-same-line-static-method-literal-names-asi.js b/test/language/expressions/class/fields-after-same-line-static-method-literal-names-asi.js new file mode 100644 index 0000000000..54566a3479 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-literal-names-asi.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Literal property names with ASI (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + static m() { return 42; } a + b = 42;; + +} + +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(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/fields-multiple-definitions-literal-names-asi.js b/test/language/expressions/class/fields-multiple-definitions-literal-names-asi.js new file mode 100644 index 0000000000..74fd80c2f7 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-literal-names-asi.js @@ -0,0 +1,96 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-expr-multiple-definitions.template +/*--- +description: Literal property names with ASI (multiple fields definitions) +esid: prod-FieldDefinition +features: [class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + a + b = 42; + m2() { return 39 } + bar = "barbaz"; + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-literal-names-asi.js b/test/language/expressions/class/fields-multiple-stacked-definitions-literal-names-asi.js new file mode 100644 index 0000000000..08d39ea46c --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-literal-names-asi.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Literal property names with ASI (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + a + b = 42; + foo = "foobar" + bar = "barbaz"; + +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-literal-names-asi.js b/test/language/expressions/class/fields-new-no-sc-line-method-literal-names-asi.js new file mode 100644 index 0000000000..fcbc885124 --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-literal-names-asi.js @@ -0,0 +1,61 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Literal property names with ASI (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + a + b = 42; + m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/fields-new-sc-line-gen-literal-names-asi.js b/test/language/expressions/class/fields-new-sc-line-gen-literal-names-asi.js new file mode 100644 index 0000000000..e8a7097b2e --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-literal-names-asi.js @@ -0,0 +1,61 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Literal property names with ASI (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + a + b = 42;; + *m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/fields-new-sc-line-method-literal-names-asi.js b/test/language/expressions/class/fields-new-sc-line-method-literal-names-asi.js new file mode 100644 index 0000000000..f98ab8c65e --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-literal-names-asi.js @@ -0,0 +1,61 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-expr-new-sc-line-method.template +/*--- +description: Literal property names with ASI (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + a + b = 42;; + m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/fields-regular-definitions-literal-names-asi.js b/test/language/expressions/class/fields-regular-definitions-literal-names-asi.js new file mode 100644 index 0000000000..95f92f5691 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-literal-names-asi.js @@ -0,0 +1,50 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-expr-regular-definitions.template +/*--- +description: Literal property names with ASI (regular fields defintion) +esid: prod-FieldDefinition +features: [class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + a + b = 42; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/fields-same-line-async-gen-literal-names-asi.js b/test/language/expressions/class/fields-same-line-async-gen-literal-names-asi.js new file mode 100644 index 0000000000..35d3ee1db6 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-literal-names-asi.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Literal property names with ASI (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + async *m() { return 42; } a + b = 42;; + +} + +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(Object.hasOwnProperty.call(C.prototype, "a"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + + verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + + verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-literal-names-asi.js b/test/language/expressions/class/fields-same-line-async-method-literal-names-asi.js new file mode 100644 index 0000000000..413ced87f5 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-literal-names-asi.js @@ -0,0 +1,73 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Literal property names with ASI (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + async m() { return 42; } a + b = 42;; + +} + +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(Object.hasOwnProperty.call(C.prototype, "a"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + + verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + + verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-gen-literal-names-asi.js b/test/language/expressions/class/fields-same-line-gen-literal-names-asi.js new file mode 100644 index 0000000000..1bbd48d5b3 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-literal-names-asi.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-expr-same-line-generator.template +/*--- +description: Literal property names with ASI (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + a + b = 42;; *m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/fields-same-line-method-literal-names-asi.js b/test/language/expressions/class/fields-same-line-method-literal-names-asi.js new file mode 100644 index 0000000000..ff7f4722a1 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-literal-names-asi.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-expr-same-line-method.template +/*--- +description: Literal property names with ASI (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + a + b = 42;; m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/fields-wrapped-in-sc-literal-names-asi.js b/test/language/expressions/class/fields-wrapped-in-sc-literal-names-asi.js new file mode 100644 index 0000000000..3c1b690ee0 --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-literal-names-asi.js @@ -0,0 +1,52 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Literal property names with ASI (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + ;;;; + ;;;;;;a + b = 42;;;;;;;; + ;;;; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/syntax-invalid-grammar-field-def-has-initializer-no-sc-error.js b/test/language/expressions/class/syntax-invalid-grammar-field-def-has-initializer-no-sc-error.js deleted file mode 100644 index bc825b5981..0000000000 --- a/test/language/expressions/class/syntax-invalid-grammar-field-def-has-initializer-no-sc-error.js +++ /dev/null @@ -1,35 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/grammar-field-def-has-initializer-no-sc-error.case -// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template -/*--- -description: SyntaxError (class expression) -esid: prod-ClassElement -features: [class-fields-private, class] -flags: [generated] -negative: - phase: parse - type: SyntaxError -info: | - - ClassElement : - MethodDefinition - static MethodDefinition - FieldDefinition ; - ; - - FieldDefinition : - ClassElementName Initializer _opt - - ClassElementName : - PropertyName - PrivateName - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -var C = class { - x = [] - y; -}; diff --git a/test/language/statements/class/fields-after-same-line-gen-literal-names-asi.js b/test/language/statements/class/fields-after-same-line-gen-literal-names-asi.js new file mode 100644 index 0000000000..8c1194f166 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-literal-names-asi.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-decl-after-same-line-gen.template +/*--- +description: Literal property names with ASI (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + *m() { return 42; } a + b = 42;; + +} + +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(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/fields-after-same-line-method-literal-names-asi.js b/test/language/statements/class/fields-after-same-line-method-literal-names-asi.js new file mode 100644 index 0000000000..53ee508026 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-literal-names-asi.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-decl-after-same-line-method.template +/*--- +description: Literal property names with ASI (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + m() { return 42; } a + b = 42;; + +} + +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(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-literal-names-asi.js b/test/language/statements/class/fields-after-same-line-static-async-gen-literal-names-asi.js new file mode 100644 index 0000000000..789d6d0a8b --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-literal-names-asi.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Literal property names with ASI (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + static async *m() { return 42; } a + b = 42;; + +} + +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(Object.hasOwnProperty.call(C.prototype, "a"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + + verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + + verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-literal-names-asi.js b/test/language/statements/class/fields-after-same-line-static-async-method-literal-names-asi.js new file mode 100644 index 0000000000..77550e6155 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-literal-names-asi.js @@ -0,0 +1,73 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Literal property names with ASI (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + static async m() { return 42; } a + b = 42;; + +} + +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(Object.hasOwnProperty.call(C.prototype, "a"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + + verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + + verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-gen-literal-names-asi.js b/test/language/statements/class/fields-after-same-line-static-gen-literal-names-asi.js new file mode 100644 index 0000000000..930fa094c3 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-literal-names-asi.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Literal property names with ASI (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + static *m() { return 42; } a + b = 42;; + +} + +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(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/fields-after-same-line-static-method-literal-names-asi.js b/test/language/statements/class/fields-after-same-line-static-method-literal-names-asi.js new file mode 100644 index 0000000000..f2a5ddda86 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-literal-names-asi.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Literal property names with ASI (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + static m() { return 42; } a + b = 42;; + +} + +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(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/fields-multiple-definitions-literal-names-asi.js b/test/language/statements/class/fields-multiple-definitions-literal-names-asi.js new file mode 100644 index 0000000000..05e4df8328 --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-literal-names-asi.js @@ -0,0 +1,96 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-decl-multiple-definitions.template +/*--- +description: Literal property names with ASI (multiple fields definitions) +esid: prod-FieldDefinition +features: [class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + foo = "foobar"; + m() { return 42 } + a + b = 42; + m2() { return 39 } + bar = "barbaz"; + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-literal-names-asi.js b/test/language/statements/class/fields-multiple-stacked-definitions-literal-names-asi.js new file mode 100644 index 0000000000..bfebc2458c --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-literal-names-asi.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Literal property names with ASI (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + a + b = 42; + foo = "foobar" + bar = "barbaz"; + +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/fields-new-no-sc-line-method-literal-names-asi.js b/test/language/statements/class/fields-new-no-sc-line-method-literal-names-asi.js new file mode 100644 index 0000000000..a8589849e9 --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-literal-names-asi.js @@ -0,0 +1,61 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Literal property names with ASI (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + a + b = 42; + m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/fields-new-sc-line-gen-literal-names-asi.js b/test/language/statements/class/fields-new-sc-line-gen-literal-names-asi.js new file mode 100644 index 0000000000..985a74b5c5 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-literal-names-asi.js @@ -0,0 +1,61 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Literal property names with ASI (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + a + b = 42;; + *m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/fields-new-sc-line-method-literal-names-asi.js b/test/language/statements/class/fields-new-sc-line-method-literal-names-asi.js new file mode 100644 index 0000000000..9a7c48d27a --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-literal-names-asi.js @@ -0,0 +1,61 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-decl-new-sc-line-method.template +/*--- +description: Literal property names with ASI (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + a + b = 42;; + m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/fields-regular-definitions-literal-names-asi.js b/test/language/statements/class/fields-regular-definitions-literal-names-asi.js new file mode 100644 index 0000000000..d973f9c268 --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-literal-names-asi.js @@ -0,0 +1,50 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-decl-regular-definitions.template +/*--- +description: Literal property names with ASI (regular fields defintion) +esid: prod-FieldDefinition +features: [class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + a + b = 42; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/fields-same-line-async-gen-literal-names-asi.js b/test/language/statements/class/fields-same-line-async-gen-literal-names-asi.js new file mode 100644 index 0000000000..8e6acab61e --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-literal-names-asi.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Literal property names with ASI (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + async *m() { return 42; } a + b = 42;; + +} + +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(Object.hasOwnProperty.call(C.prototype, "a"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + + verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + + verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-literal-names-asi.js b/test/language/statements/class/fields-same-line-async-method-literal-names-asi.js new file mode 100644 index 0000000000..b1b6d62778 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-literal-names-asi.js @@ -0,0 +1,73 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Literal property names with ASI (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + async m() { return 42; } a + b = 42;; + +} + +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(Object.hasOwnProperty.call(C.prototype, "a"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + + verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + + verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-gen-literal-names-asi.js b/test/language/statements/class/fields-same-line-gen-literal-names-asi.js new file mode 100644 index 0000000000..0455dc9a8b --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-literal-names-asi.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-decl-same-line-generator.template +/*--- +description: Literal property names with ASI (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + a + b = 42;; *m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/fields-same-line-method-literal-names-asi.js b/test/language/statements/class/fields-same-line-method-literal-names-asi.js new file mode 100644 index 0000000000..e6df12efcd --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-literal-names-asi.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-decl-same-line-method.template +/*--- +description: Literal property names with ASI (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + a + b = 42;; m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/fields-wrapped-in-sc-literal-names-asi.js b/test/language/statements/class/fields-wrapped-in-sc-literal-names-asi.js new file mode 100644 index 0000000000..a566fa0494 --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-literal-names-asi.js @@ -0,0 +1,52 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Literal property names with ASI (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + ;;;; + ;;;;;;a + b = 42;;;;;;;; + ;;;; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/syntax-invalid-grammar-field-def-has-initializer-no-sc-error.js b/test/language/statements/class/syntax-invalid-grammar-field-def-has-initializer-no-sc-error.js deleted file mode 100644 index b0eb3a3a07..0000000000 --- a/test/language/statements/class/syntax-invalid-grammar-field-def-has-initializer-no-sc-error.js +++ /dev/null @@ -1,35 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/grammar-field-def-has-initializer-no-sc-error.case -// - src/class-fields/syntax/invalid/cls-decl-fields-invalid-syntax.template -/*--- -description: SyntaxError (class declaration) -esid: prod-ClassElement -features: [class-fields-private, class] -flags: [generated] -negative: - phase: parse - type: SyntaxError -info: | - - ClassElement : - MethodDefinition - static MethodDefinition - FieldDefinition ; - ; - - FieldDefinition : - ClassElementName Initializer _opt - - ClassElementName : - PropertyName - PrivateName - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -class C { - x = [] - y; -}