diff --git a/test/language/expressions/class/fields-computed-name-propname-constructor.js b/test/language/expressions/class/fields-computed-name-propname-constructor.js index 0ea94af6ab..f5ff6b9f7f 100644 --- a/test/language/expressions/class/fields-computed-name-propname-constructor.js +++ b/test/language/expressions/class/fields-computed-name-propname-constructor.js @@ -2,7 +2,7 @@ // - src/class-fields/propname-constructor.case // - src/class-fields/propname-error/cls-expr-computed-name.template /*--- -description: Static class fields cannot have PropName 'constructor' (computed) +description: class fields forbid PropName 'constructor' (no early error -- PropName of ComputedPropertyName not forbidden value) esid: sec-class-definitions-static-semantics-early-errors features: [class-fields] flags: [generated] diff --git a/test/language/expressions/class/fields-computed-name-static-propname-constructor.js b/test/language/expressions/class/fields-computed-name-static-propname-constructor.js index 96c4830c6c..e9c0cb9a9e 100644 --- a/test/language/expressions/class/fields-computed-name-static-propname-constructor.js +++ b/test/language/expressions/class/fields-computed-name-static-propname-constructor.js @@ -2,7 +2,7 @@ // - src/class-fields/static-propname-constructor.case // - src/class-fields/propname-error/cls-expr-computed-name.template /*--- -description: Static class field cannot have PropName 'constructor' (computed) +description: static class field forbid PropName 'constructor' (no early error -- PropName of ComputedPropertyName not forbidden value) esid: sec-class-definitions-static-semantics-early-errors features: [class-fields] flags: [generated] diff --git a/test/language/expressions/class/fields-computed-name-static-propname-prototype.js b/test/language/expressions/class/fields-computed-name-static-propname-prototype.js index d1a3c6ef98..adfc8c4c31 100644 --- a/test/language/expressions/class/fields-computed-name-static-propname-prototype.js +++ b/test/language/expressions/class/fields-computed-name-static-propname-prototype.js @@ -2,7 +2,7 @@ // - src/class-fields/static-propname-prototype.case // - src/class-fields/propname-error/cls-expr-computed-name.template /*--- -description: Static class fields cannot have PropName 'prototype' (computed) +description: static class fields forbid PropName 'prototype' (no early error -- PropName of ComputedPropertyName not forbidden value) esid: sec-class-definitions-static-semantics-early-errors features: [class-fields] flags: [generated] diff --git a/test/language/expressions/class/fields-computed-variable-name-propname-constructor.js b/test/language/expressions/class/fields-computed-variable-name-propname-constructor.js new file mode 100644 index 0000000000..c7b5928723 --- /dev/null +++ b/test/language/expressions/class/fields-computed-variable-name-propname-constructor.js @@ -0,0 +1,32 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/propname-constructor.case +// - src/class-fields/propname-error/cls-expr-variable-name.template +/*--- +description: class fields forbid PropName 'constructor' (no early error -- PropName of ComputedPropertyName not forbidden value) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +info: | + Static Semantics: PropName + ... + ComputedPropertyName : [ AssignmentExpression ] + Return empty. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : FieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "constructor". + +---*/ + + +var constructor = 'foo'; +var C = class { + [constructor]; +} + +var c = new C(); + +assert.sameValue(c.hasOwnProperty("foo"), true); diff --git a/test/language/expressions/class/fields-computed-variable-name-static-propname-constructor.js b/test/language/expressions/class/fields-computed-variable-name-static-propname-constructor.js new file mode 100644 index 0000000000..07ceecee42 --- /dev/null +++ b/test/language/expressions/class/fields-computed-variable-name-static-propname-constructor.js @@ -0,0 +1,32 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-propname-constructor.case +// - src/class-fields/propname-error/cls-expr-variable-name.template +/*--- +description: static class field forbid PropName 'constructor' (no early error -- PropName of ComputedPropertyName not forbidden value) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +info: | + Static Semantics: PropName + ... + ComputedPropertyName : [ AssignmentExpression ] + Return empty. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : staticFieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". + +---*/ + + +var constructor = 'foo'; +var C = class { + static [constructor]; +} + +var c = new C(); + +assert.sameValue(c.hasOwnProperty("foo"), true); diff --git a/test/language/expressions/class/fields-computed-variable-name-static-propname-prototype.js b/test/language/expressions/class/fields-computed-variable-name-static-propname-prototype.js new file mode 100644 index 0000000000..baa7002324 --- /dev/null +++ b/test/language/expressions/class/fields-computed-variable-name-static-propname-prototype.js @@ -0,0 +1,32 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-propname-prototype.case +// - src/class-fields/propname-error/cls-expr-variable-name.template +/*--- +description: static class fields forbid PropName 'prototype' (no early error -- PropName of ComputedPropertyName not forbidden value) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +info: | + Static Semantics: PropName + ... + ComputedPropertyName : [ AssignmentExpression ] + Return empty. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : staticFieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". + +---*/ + + +var prototype = 'foo'; +var C = class { + static [prototype]; +} + +var c = new C(); + +assert.sameValue(c.hasOwnProperty("foo"), true); diff --git a/test/language/expressions/class/fields-literal-name-propname-constructor.js b/test/language/expressions/class/fields-literal-name-propname-constructor.js index 2e868f5869..7e6f815523 100644 --- a/test/language/expressions/class/fields-literal-name-propname-constructor.js +++ b/test/language/expressions/class/fields-literal-name-propname-constructor.js @@ -2,7 +2,7 @@ // - src/class-fields/propname-constructor.case // - src/class-fields/propname-error/cls-expr-literal-name.template /*--- -description: Static class fields cannot have PropName 'constructor' (literal name) +description: class fields forbid PropName 'constructor' (early error -- PropName of IdentifierName is forbidden) esid: sec-class-definitions-static-semantics-early-errors features: [class-fields] flags: [generated] diff --git a/test/language/expressions/class/fields-literal-name-static-propname-constructor.js b/test/language/expressions/class/fields-literal-name-static-propname-constructor.js index 575a9c99a7..242decedcc 100644 --- a/test/language/expressions/class/fields-literal-name-static-propname-constructor.js +++ b/test/language/expressions/class/fields-literal-name-static-propname-constructor.js @@ -2,7 +2,7 @@ // - src/class-fields/static-propname-constructor.case // - src/class-fields/propname-error/cls-expr-literal-name.template /*--- -description: Static class field cannot have PropName 'constructor' (literal name) +description: static class field forbid PropName 'constructor' (early error -- PropName of IdentifierName is forbidden) esid: sec-class-definitions-static-semantics-early-errors features: [class-fields] flags: [generated] diff --git a/test/language/expressions/class/fields-literal-name-static-propname-prototype.js b/test/language/expressions/class/fields-literal-name-static-propname-prototype.js index b76526aba5..8757af59ed 100644 --- a/test/language/expressions/class/fields-literal-name-static-propname-prototype.js +++ b/test/language/expressions/class/fields-literal-name-static-propname-prototype.js @@ -2,7 +2,7 @@ // - src/class-fields/static-propname-prototype.case // - src/class-fields/propname-error/cls-expr-literal-name.template /*--- -description: Static class fields cannot have PropName 'prototype' (literal name) +description: static class fields forbid PropName 'prototype' (early error -- PropName of IdentifierName is forbidden) esid: sec-class-definitions-static-semantics-early-errors features: [class-fields] flags: [generated] diff --git a/test/language/expressions/class/fields-string-name-propname-constructor.js b/test/language/expressions/class/fields-string-name-propname-constructor.js index 487301bd0f..06e0261b06 100644 --- a/test/language/expressions/class/fields-string-name-propname-constructor.js +++ b/test/language/expressions/class/fields-string-name-propname-constructor.js @@ -2,7 +2,7 @@ // - src/class-fields/propname-constructor.case // - src/class-fields/propname-error/cls-expr-string-name.template /*--- -description: Static class fields cannot have PropName 'constructor' (string name) +description: class fields forbid PropName 'constructor' (early error -- PropName of StringLiteral is forbidden) esid: sec-class-definitions-static-semantics-early-errors features: [class-fields] flags: [generated] @@ -12,7 +12,7 @@ negative: info: | Static Semantics: PropName ... - LiteralPropertyName:StringLiteral + LiteralPropertyName : StringLiteral Return the String value whose code units are the SV of the StringLiteral. diff --git a/test/language/expressions/class/fields-string-name-static-propname-constructor.js b/test/language/expressions/class/fields-string-name-static-propname-constructor.js index 9b695f8dfe..bf52ad29c7 100644 --- a/test/language/expressions/class/fields-string-name-static-propname-constructor.js +++ b/test/language/expressions/class/fields-string-name-static-propname-constructor.js @@ -2,7 +2,7 @@ // - src/class-fields/static-propname-constructor.case // - src/class-fields/propname-error/cls-expr-string-name.template /*--- -description: Static class field cannot have PropName 'constructor' (string name) +description: static class field forbid PropName 'constructor' (early error -- PropName of StringLiteral is forbidden) esid: sec-class-definitions-static-semantics-early-errors features: [class-fields] flags: [generated] @@ -12,7 +12,7 @@ negative: info: | Static Semantics: PropName ... - LiteralPropertyName:StringLiteral + LiteralPropertyName : StringLiteral Return the String value whose code units are the SV of the StringLiteral. diff --git a/test/language/expressions/class/fields-string-name-static-propname-prototype.js b/test/language/expressions/class/fields-string-name-static-propname-prototype.js index b3a28a18ee..69baf56845 100644 --- a/test/language/expressions/class/fields-string-name-static-propname-prototype.js +++ b/test/language/expressions/class/fields-string-name-static-propname-prototype.js @@ -2,7 +2,7 @@ // - src/class-fields/static-propname-prototype.case // - src/class-fields/propname-error/cls-expr-string-name.template /*--- -description: Static class fields cannot have PropName 'prototype' (string name) +description: static class fields forbid PropName 'prototype' (early error -- PropName of StringLiteral is forbidden) esid: sec-class-definitions-static-semantics-early-errors features: [class-fields] flags: [generated] @@ -12,7 +12,7 @@ negative: info: | Static Semantics: PropName ... - LiteralPropertyName:StringLiteral + LiteralPropertyName : StringLiteral Return the String value whose code units are the SV of the StringLiteral. diff --git a/test/language/statements/class/fields-computed-name-propname-constructor.js b/test/language/statements/class/fields-computed-name-propname-constructor.js index 238e373b28..5d3b632fad 100644 --- a/test/language/statements/class/fields-computed-name-propname-constructor.js +++ b/test/language/statements/class/fields-computed-name-propname-constructor.js @@ -2,7 +2,7 @@ // - src/class-fields/propname-constructor.case // - src/class-fields/propname-error/cls-decl-computed-name.template /*--- -description: Static class fields cannot have PropName 'constructor' (computed) +description: class fields forbid PropName 'constructor' (no early error -- PropName of ComputedPropertyName not forbidden value) esid: sec-class-definitions-static-semantics-early-errors features: [class-fields] flags: [generated] diff --git a/test/language/statements/class/fields-computed-name-static-propname-constructor.js b/test/language/statements/class/fields-computed-name-static-propname-constructor.js index e9be37e0a7..b55077f4ba 100644 --- a/test/language/statements/class/fields-computed-name-static-propname-constructor.js +++ b/test/language/statements/class/fields-computed-name-static-propname-constructor.js @@ -2,7 +2,7 @@ // - src/class-fields/static-propname-constructor.case // - src/class-fields/propname-error/cls-decl-computed-name.template /*--- -description: Static class field cannot have PropName 'constructor' (computed) +description: static class field forbid PropName 'constructor' (no early error -- PropName of ComputedPropertyName not forbidden value) esid: sec-class-definitions-static-semantics-early-errors features: [class-fields] flags: [generated] diff --git a/test/language/statements/class/fields-computed-name-static-propname-prototype.js b/test/language/statements/class/fields-computed-name-static-propname-prototype.js index 2835696615..e8fd0641ed 100644 --- a/test/language/statements/class/fields-computed-name-static-propname-prototype.js +++ b/test/language/statements/class/fields-computed-name-static-propname-prototype.js @@ -2,7 +2,7 @@ // - src/class-fields/static-propname-prototype.case // - src/class-fields/propname-error/cls-decl-computed-name.template /*--- -description: Static class fields cannot have PropName 'prototype' (computed) +description: static class fields forbid PropName 'prototype' (no early error -- PropName of ComputedPropertyName not forbidden value) esid: sec-class-definitions-static-semantics-early-errors features: [class-fields] flags: [generated] diff --git a/test/language/statements/class/fields-computed-variable-name-propname-constructor.js b/test/language/statements/class/fields-computed-variable-name-propname-constructor.js new file mode 100644 index 0000000000..c538d7d2ed --- /dev/null +++ b/test/language/statements/class/fields-computed-variable-name-propname-constructor.js @@ -0,0 +1,32 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/propname-constructor.case +// - src/class-fields/propname-error/cls-decl-variable-name.template +/*--- +description: class fields forbid PropName 'constructor' (no early error -- PropName of ComputedPropertyName not forbidden value) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +info: | + Static Semantics: PropName + ... + ComputedPropertyName : [ AssignmentExpression ] + Return empty. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : FieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "constructor". + +---*/ + + +var constructor = 'foo'; +class C { + [constructor]; +} + +var c = new C(); + +assert.sameValue(c.hasOwnProperty("foo"), true); diff --git a/test/language/statements/class/fields-computed-variable-name-static-propname-constructor.js b/test/language/statements/class/fields-computed-variable-name-static-propname-constructor.js new file mode 100644 index 0000000000..906c821aa2 --- /dev/null +++ b/test/language/statements/class/fields-computed-variable-name-static-propname-constructor.js @@ -0,0 +1,32 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-propname-constructor.case +// - src/class-fields/propname-error/cls-decl-variable-name.template +/*--- +description: static class field forbid PropName 'constructor' (no early error -- PropName of ComputedPropertyName not forbidden value) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +info: | + Static Semantics: PropName + ... + ComputedPropertyName : [ AssignmentExpression ] + Return empty. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : staticFieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". + +---*/ + + +var constructor = 'foo'; +class C { + static [constructor]; +} + +var c = new C(); + +assert.sameValue(c.hasOwnProperty("foo"), true); diff --git a/test/language/statements/class/fields-computed-variable-name-static-propname-prototype.js b/test/language/statements/class/fields-computed-variable-name-static-propname-prototype.js new file mode 100644 index 0000000000..5de8dc2f56 --- /dev/null +++ b/test/language/statements/class/fields-computed-variable-name-static-propname-prototype.js @@ -0,0 +1,32 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-propname-prototype.case +// - src/class-fields/propname-error/cls-decl-variable-name.template +/*--- +description: static class fields forbid PropName 'prototype' (no early error -- PropName of ComputedPropertyName not forbidden value) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +info: | + Static Semantics: PropName + ... + ComputedPropertyName : [ AssignmentExpression ] + Return empty. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : staticFieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". + +---*/ + + +var prototype = 'foo'; +class C { + static [prototype]; +} + +var c = new C(); + +assert.sameValue(c.hasOwnProperty("foo"), true); diff --git a/test/language/statements/class/fields-literal-name-propname-constructor.js b/test/language/statements/class/fields-literal-name-propname-constructor.js index 9167ba7d37..2e8089661f 100644 --- a/test/language/statements/class/fields-literal-name-propname-constructor.js +++ b/test/language/statements/class/fields-literal-name-propname-constructor.js @@ -2,7 +2,7 @@ // - src/class-fields/propname-constructor.case // - src/class-fields/propname-error/cls-decl-literal-name.template /*--- -description: Static class fields cannot have PropName 'constructor' (literal name) +description: class fields forbid PropName 'constructor' (early error -- PropName of IdentifierName is forbidden value) esid: sec-class-definitions-static-semantics-early-errors features: [class-fields] flags: [generated] diff --git a/test/language/statements/class/fields-literal-name-static-propname-constructor.js b/test/language/statements/class/fields-literal-name-static-propname-constructor.js index e66a47dbc8..3b7e8e66f8 100644 --- a/test/language/statements/class/fields-literal-name-static-propname-constructor.js +++ b/test/language/statements/class/fields-literal-name-static-propname-constructor.js @@ -2,7 +2,7 @@ // - src/class-fields/static-propname-constructor.case // - src/class-fields/propname-error/cls-decl-literal-name.template /*--- -description: Static class field cannot have PropName 'constructor' (literal name) +description: static class field forbid PropName 'constructor' (early error -- PropName of IdentifierName is forbidden value) esid: sec-class-definitions-static-semantics-early-errors features: [class-fields] flags: [generated] diff --git a/test/language/statements/class/fields-literal-name-static-propname-prototype.js b/test/language/statements/class/fields-literal-name-static-propname-prototype.js index b2818e7230..736391bee4 100644 --- a/test/language/statements/class/fields-literal-name-static-propname-prototype.js +++ b/test/language/statements/class/fields-literal-name-static-propname-prototype.js @@ -2,7 +2,7 @@ // - src/class-fields/static-propname-prototype.case // - src/class-fields/propname-error/cls-decl-literal-name.template /*--- -description: Static class fields cannot have PropName 'prototype' (literal name) +description: static class fields forbid PropName 'prototype' (early error -- PropName of IdentifierName is forbidden value) esid: sec-class-definitions-static-semantics-early-errors features: [class-fields] flags: [generated] diff --git a/test/language/statements/class/fields-string-name-propname-constructor.js b/test/language/statements/class/fields-string-name-propname-constructor.js index 01b53e20b8..0e72cc4956 100644 --- a/test/language/statements/class/fields-string-name-propname-constructor.js +++ b/test/language/statements/class/fields-string-name-propname-constructor.js @@ -2,7 +2,7 @@ // - src/class-fields/propname-constructor.case // - src/class-fields/propname-error/cls-decl-string-name.template /*--- -description: Static class fields cannot have PropName 'constructor' (string name) +description: class fields forbid PropName 'constructor' (early error -- PropName of StringLiteral is forbidden value) esid: sec-class-definitions-static-semantics-early-errors features: [class-fields] flags: [generated] @@ -12,7 +12,7 @@ negative: info: | Static Semantics: PropName ... - LiteralPropertyName:StringLiteral + LiteralPropertyName : StringLiteral Return the String value whose code units are the SV of the StringLiteral. diff --git a/test/language/statements/class/fields-string-name-static-propname-constructor.js b/test/language/statements/class/fields-string-name-static-propname-constructor.js index 0a33f6204f..ff31d8ec0a 100644 --- a/test/language/statements/class/fields-string-name-static-propname-constructor.js +++ b/test/language/statements/class/fields-string-name-static-propname-constructor.js @@ -2,7 +2,7 @@ // - src/class-fields/static-propname-constructor.case // - src/class-fields/propname-error/cls-decl-string-name.template /*--- -description: Static class field cannot have PropName 'constructor' (string name) +description: static class field forbid PropName 'constructor' (early error -- PropName of StringLiteral is forbidden value) esid: sec-class-definitions-static-semantics-early-errors features: [class-fields] flags: [generated] @@ -12,7 +12,7 @@ negative: info: | Static Semantics: PropName ... - LiteralPropertyName:StringLiteral + LiteralPropertyName : StringLiteral Return the String value whose code units are the SV of the StringLiteral. diff --git a/test/language/statements/class/fields-string-name-static-propname-prototype.js b/test/language/statements/class/fields-string-name-static-propname-prototype.js index 74c89cd445..24de80aaeb 100644 --- a/test/language/statements/class/fields-string-name-static-propname-prototype.js +++ b/test/language/statements/class/fields-string-name-static-propname-prototype.js @@ -2,7 +2,7 @@ // - src/class-fields/static-propname-prototype.case // - src/class-fields/propname-error/cls-decl-string-name.template /*--- -description: Static class fields cannot have PropName 'prototype' (string name) +description: static class fields forbid PropName 'prototype' (early error -- PropName of StringLiteral is forbidden value) esid: sec-class-definitions-static-semantics-early-errors features: [class-fields] flags: [generated] @@ -12,7 +12,7 @@ negative: info: | Static Semantics: PropName ... - LiteralPropertyName:StringLiteral + LiteralPropertyName : StringLiteral Return the String value whose code units are the SV of the StringLiteral.