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 0240885ef8b7e192882a27e513d81de7c3ad60d5..0050e3a7e58505d72435f6ab308e2c052ac5f59e 100644 --- a/test/language/expressions/class/fields-computed-name-propname-constructor.js +++ b/test/language/expressions/class/fields-computed-name-propname-constructor.js @@ -1,33 +1,32 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/propname-constructor.case -// - src/class-fields/propname-error/cls-expr-computed-name.template +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. /*--- 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, class-fields-public] -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". + +negative: + phase: parse + type: SyntaxError + ---*/ +throw "Test262: This statement should not be evaluated."; var x = "constructor"; var C = class { [x]; }; - -var c = new C(); -assert.sameValue(c.hasOwnProperty("constructor"), true); - -assert.sameValue(C.hasOwnProperty("constructor"), false); 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 new file mode 100644 index 0000000000000000000000000000000000000000..748e3fb53f3ba2c8b9abd08aeff9e63c6b298a2a --- /dev/null +++ b/test/language/expressions/class/fields-computed-name-static-propname-constructor.js @@ -0,0 +1,31 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +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, class-fields-public] +info: | + Static Semantics: PropName + ... + ComputedPropertyName : [ AssignmentExpression ] + Return empty. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : static FieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". + +negative: + phase: parse + type: SyntaxError + +---*/ + +throw "Test262: This statement should not be evaluated."; + +var x = "constructor"; +var C = class { + static [x]; +}; 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 new file mode 100644 index 0000000000000000000000000000000000000000..3d374d8d003cdbd37e3182f6b3215774a2ef956c --- /dev/null +++ b/test/language/expressions/class/fields-computed-name-static-propname-prototype.js @@ -0,0 +1,32 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +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, class-fields-public] +info: | + Static Semantics: PropName + ... + ComputedPropertyName : [ AssignmentExpression ] + Return empty. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : static FieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". + +negative: + phase: parse + type: SyntaxError + +---*/ + +throw "Test262: This statement should not be evaluated."; + + +var x = "prototype"; +var C = class { + static [x]; +}; 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 bbb618c1cd29fbd7dc201a41731a91a0caeacdb1..fc3b3545e1306996e8bdb729e4225563c283024f 100644 --- a/test/language/expressions/class/fields-literal-name-propname-constructor.js +++ b/test/language/expressions/class/fields-literal-name-propname-constructor.js @@ -1,11 +1,9 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/propname-constructor.case -// - src/class-fields/propname-error/cls-expr-literal-name.template +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. /*--- description: class fields forbid PropName 'constructor' (early error -- PropName of IdentifierName is forbidden) esid: sec-class-definitions-static-semantics-early-errors features: [class, class-fields-public] -flags: [generated] negative: phase: parse type: SyntaxError @@ -14,7 +12,7 @@ info: | LiteralPropertyName : IdentifierName Return StringValue of IdentifierName. - + // This test file tests the following early error: Static Semantics: Early Errors 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 new file mode 100644 index 0000000000000000000000000000000000000000..fbfea2a7bd132b6d3d0f0223671f47f9ccaba076 --- /dev/null +++ b/test/language/expressions/class/fields-literal-name-static-propname-constructor.js @@ -0,0 +1,29 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: static class field forbid PropName 'constructor' (early error -- PropName of IdentifierName is forbidden) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-public] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: PropName + LiteralPropertyName : IdentifierName + Return StringValue of IdentifierName. + + + // 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". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + static constructor; +}; 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 new file mode 100644 index 0000000000000000000000000000000000000000..3599dd4450e287feea603e2cf7ce0b8afc9d1b61 --- /dev/null +++ b/test/language/expressions/class/fields-literal-name-static-propname-prototype.js @@ -0,0 +1,29 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: static class fields forbid PropName 'prototype' (early error -- PropName of IdentifierName is forbidden) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-public] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: PropName + LiteralPropertyName : IdentifierName + Return StringValue of IdentifierName. + + + // 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". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + static prototype; +}; 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 039c915a470fc4c53cb7b2e386924344f377985d..d88b246392734d13c7f1cff28d3f0d50adf73402 100644 --- a/test/language/expressions/class/fields-string-name-propname-constructor.js +++ b/test/language/expressions/class/fields-string-name-propname-constructor.js @@ -1,11 +1,9 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/propname-constructor.case -// - src/class-fields/propname-error/cls-expr-string-name.template +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. /*--- description: class fields forbid PropName 'constructor' (early error -- PropName of StringLiteral is forbidden) esid: sec-class-definitions-static-semantics-early-errors features: [class, class-fields-public] -flags: [generated] negative: phase: parse type: SyntaxError @@ -15,7 +13,7 @@ info: | LiteralPropertyName : StringLiteral Return the String value whose code units are the SV of the StringLiteral. - + // This test file tests the following early error: Static Semantics: Early Errors 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 new file mode 100644 index 0000000000000000000000000000000000000000..08a0f7b89062d608eabef02b9826cc9857ff42b5 --- /dev/null +++ b/test/language/expressions/class/fields-string-name-static-propname-constructor.js @@ -0,0 +1,30 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: static class field forbid PropName 'constructor' (early error -- PropName of StringLiteral is forbidden) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-public] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: PropName + ... + LiteralPropertyName : StringLiteral + Return the String value whose code units are the SV of the StringLiteral. + + + // 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". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + static 'constructor'; +}; 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 new file mode 100644 index 0000000000000000000000000000000000000000..43078702caf6695d358cfc46178e085fbc04f93f --- /dev/null +++ b/test/language/expressions/class/fields-string-name-static-propname-prototype.js @@ -0,0 +1,30 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: static class fields forbid PropName 'prototype' (early error -- PropName of StringLiteral is forbidden) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-public] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: PropName + ... + LiteralPropertyName : StringLiteral + Return the String value whose code units are the SV of the StringLiteral. + + + // 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". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + static 'prototype'; +}; 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 f528e03bd2b63481655d2d511b3f34452ac4aec3..46e19b73a8754b244398a9e1256ac21ef943e6dc 100644 --- a/test/language/statements/class/fields-computed-name-propname-constructor.js +++ b/test/language/statements/class/fields-computed-name-propname-constructor.js @@ -1,26 +1,29 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/propname-constructor.case -// - src/class-fields/propname-error/cls-decl-computed-name.template +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. /*--- 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, class-fields-public] -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". +negative: + phase: parse + type: SyntaxError + ---*/ +throw "Test262: This statement should not be evaluated."; var x = "constructor"; class C { diff --git a/test/language/statements/class/fields-computed-name-static-computed-var-propname-constructor.js b/test/language/statements/class/fields-computed-name-static-computed-var-propname-constructor.js new file mode 100644 index 0000000000000000000000000000000000000000..1963899949e56b769bf2c78447568d39debc32ca --- /dev/null +++ b/test/language/statements/class/fields-computed-name-static-computed-var-propname-constructor.js @@ -0,0 +1,31 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +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, class-static-fields-public] +info: | + Static Semantics: PropName + ... + ComputedPropertyName : [ AssignmentExpression ] + Return empty. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : static FieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". + +negative: + phase: parse + type: SyntaxError + +---*/ + +throw "Test262: This statement should not be evaluated."; + +var x = "constructor"; +class C { + static [x]; +} diff --git a/test/language/statements/class/fields-computed-name-static-computed-var-propname-prototype.js b/test/language/statements/class/fields-computed-name-static-computed-var-propname-prototype.js new file mode 100644 index 0000000000000000000000000000000000000000..4186915a5f1ff2f98614fe2b3b7cf222e1141530 --- /dev/null +++ b/test/language/statements/class/fields-computed-name-static-computed-var-propname-prototype.js @@ -0,0 +1,31 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +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, class-static-fields-public] +info: | + Static Semantics: PropName + ... + ComputedPropertyName : [ AssignmentExpression ] + Return empty. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : static FieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". + +negative: + phase: parse + type: SyntaxError + +---*/ + +throw "Test262: This statement should not be evaluated."; + +var x = "prototype"; +class C { + static [x]; +} 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 new file mode 100644 index 0000000000000000000000000000000000000000..218a01bfe5f1c1c0228033a03f307977faa30779 --- /dev/null +++ b/test/language/statements/class/fields-computed-name-static-propname-constructor.js @@ -0,0 +1,30 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +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-static-fields-public] +info: | + Static Semantics: PropName + ... + ComputedPropertyName : [ AssignmentExpression ] + Return empty. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : static FieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". + +negative: + phase: parse + type: SyntaxError + +---*/ + +throw "Test262: This statement should not be evaluated."; + +class C { + static ["constructor"]; +} 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 new file mode 100644 index 0000000000000000000000000000000000000000..32e416a369b2867a7f81f56894860b1e95e98c22 --- /dev/null +++ b/test/language/statements/class/fields-computed-name-static-propname-prototype.js @@ -0,0 +1,30 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +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-static-fields-public] +info: | + Static Semantics: PropName + ... + ComputedPropertyName : [ AssignmentExpression ] + Return empty. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : static FieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". + +negative: + phase: parse + type: SyntaxError + +---*/ + +throw "Test262: This statement should not be evaluated."; + +class C { + static ["prototype"]; +} 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 a09cc62f66f0f29a769360d95ed240c8474802c8..614524237375fecca8df5014852b131205aa53a5 100644 --- a/test/language/statements/class/fields-literal-name-propname-constructor.js +++ b/test/language/statements/class/fields-literal-name-propname-constructor.js @@ -1,11 +1,9 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/propname-constructor.case -// - src/class-fields/propname-error/cls-decl-literal-name.template +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. /*--- description: class fields forbid PropName 'constructor' (early error -- PropName of IdentifierName is forbidden value) esid: sec-class-definitions-static-semantics-early-errors features: [class, class-fields-public] -flags: [generated] negative: phase: parse type: SyntaxError @@ -14,7 +12,7 @@ info: | LiteralPropertyName : IdentifierName Return StringValue of IdentifierName. - + // This test file tests the following early error: Static Semantics: Early Errors 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 new file mode 100644 index 0000000000000000000000000000000000000000..bb27a99d4eb0fd9be82f6b94ca8a4551d1cf4391 --- /dev/null +++ b/test/language/statements/class/fields-literal-name-static-propname-constructor.js @@ -0,0 +1,29 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +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, class-static-fields-public] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: PropName + LiteralPropertyName : IdentifierName + Return StringValue of IdentifierName. + + + // 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". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + static constructor; +} 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 new file mode 100644 index 0000000000000000000000000000000000000000..9d18ad1e5a967cdbe80f6a480c23284589612fe0 --- /dev/null +++ b/test/language/statements/class/fields-literal-name-static-propname-prototype.js @@ -0,0 +1,29 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +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, class-static-fields-public] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: PropName + LiteralPropertyName : IdentifierName + Return StringValue of IdentifierName. + + + // 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". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + static prototype; +} 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 1cc9c51530b44290920834776e7679a37ef9b735..114b17b405e2fe824ecb257ddbdf99b25cabc6b6 100644 --- a/test/language/statements/class/fields-string-name-propname-constructor.js +++ b/test/language/statements/class/fields-string-name-propname-constructor.js @@ -1,11 +1,9 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/propname-constructor.case -// - src/class-fields/propname-error/cls-decl-string-name.template +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. /*--- description: class fields forbid PropName 'constructor' (early error -- PropName of StringLiteral is forbidden value) esid: sec-class-definitions-static-semantics-early-errors features: [class, class-fields-public] -flags: [generated] negative: phase: parse type: SyntaxError @@ -15,7 +13,7 @@ info: | LiteralPropertyName : StringLiteral Return the String value whose code units are the SV of the StringLiteral. - + // This test file tests the following early error: Static Semantics: Early Errors 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 7013df4a703789ccf2e545d7e3a6aef534e44878..59349a8ad95b95f603b777606d958d347004826c 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 @@ -1,11 +1,9 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-propname-constructor.case -// - src/class-fields/propname-error/cls-decl-string-name.template +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. /*--- 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] +features: [class, class-static-fields-public] negative: phase: parse type: SyntaxError @@ -15,7 +13,7 @@ info: | LiteralPropertyName : StringLiteral Return the String value whose code units are the SV of the StringLiteral. - + // This test file tests the following early error: Static Semantics: Early Errors @@ -28,5 +26,5 @@ info: | throw "Test262: This statement should not be evaluated."; class C { - 'constructor'; + static 'constructor'; } 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 a054249ef4702c32a780101598ad6d60977289e9..aa56e8688a661b8d1adcde8dec4278915317cdfd 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 @@ -1,11 +1,9 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-propname-prototype.case -// - src/class-fields/propname-error/cls-decl-string-name.template +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. /*--- 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] +features: [class, class-static-fields-public] negative: phase: parse type: SyntaxError @@ -15,7 +13,7 @@ info: | LiteralPropertyName : StringLiteral Return the String value whose code units are the SV of the StringLiteral. - + // This test file tests the following early error: Static Semantics: Early Errors @@ -28,5 +26,5 @@ info: | throw "Test262: This statement should not be evaluated."; class C { - 'prototype'; + static 'prototype'; }