From 2ab51b3a7347f8b5216b7bfa26d0ab20cbc47f5e Mon Sep 17 00:00:00 2001 From: Valerie R Young Date: Thu, 12 Oct 2017 17:30:16 -0400 Subject: [PATCH 1/2] class fields: add early errors for argument and super --- .../init-err-contains-boolean.case | 28 +++++++++++++++++++ src/class-fields/init-err-contains-super.case | 21 ++++++++++++++ .../cls-decl-fields-arrow-fnc.template | 15 ++++++++++ .../cls-decl-fields-comp-name.template | 15 ++++++++++ .../cls-decl-fields-equality.template | 14 ++++++++++ .../cls-decl-fields-literal-name.template | 14 ++++++++++ .../cls-decl-fields-static-comp-name.template | 15 ++++++++++ ...s-decl-fields-static-literal-name.template | 14 ++++++++++ ...fields-static-string-literal-name.template | 14 ++++++++++ ...s-decl-fields-string-literal-name.template | 14 ++++++++++ .../cls-decl-fields-ternary.template | 14 ++++++++++ .../cls-decl-fields-typeof.template | 14 ++++++++++ .../cls-expr-fields-arrow-fnc.template | 15 ++++++++++ .../cls-expr-fields-comp-name.template | 15 ++++++++++ .../cls-expr-fields-equality.template | 14 ++++++++++ .../cls-expr-fields-literal-name.template | 14 ++++++++++ .../cls-expr-fields-static-comp-name.template | 15 ++++++++++ ...s-expr-fields-static-literal-name.template | 14 ++++++++++ ...fields-static-string-literal-name.template | 14 ++++++++++ ...s-expr-fields-string-literal-name.template | 14 ++++++++++ .../cls-expr-fields-ternary.template | 14 ++++++++++ .../cls-expr-fields-typeof.template | 14 ++++++++++ 22 files changed, 335 insertions(+) create mode 100644 src/class-fields/init-err-contains-boolean.case create mode 100644 src/class-fields/init-err-contains-super.case create mode 100644 src/class-fields/initializer-error/cls-decl-fields-arrow-fnc.template create mode 100644 src/class-fields/initializer-error/cls-decl-fields-comp-name.template create mode 100644 src/class-fields/initializer-error/cls-decl-fields-equality.template create mode 100644 src/class-fields/initializer-error/cls-decl-fields-literal-name.template create mode 100644 src/class-fields/initializer-error/cls-decl-fields-static-comp-name.template create mode 100644 src/class-fields/initializer-error/cls-decl-fields-static-literal-name.template create mode 100644 src/class-fields/initializer-error/cls-decl-fields-static-string-literal-name.template create mode 100644 src/class-fields/initializer-error/cls-decl-fields-string-literal-name.template create mode 100644 src/class-fields/initializer-error/cls-decl-fields-ternary.template create mode 100644 src/class-fields/initializer-error/cls-decl-fields-typeof.template create mode 100644 src/class-fields/initializer-error/cls-expr-fields-arrow-fnc.template create mode 100644 src/class-fields/initializer-error/cls-expr-fields-comp-name.template create mode 100644 src/class-fields/initializer-error/cls-expr-fields-equality.template create mode 100644 src/class-fields/initializer-error/cls-expr-fields-literal-name.template create mode 100644 src/class-fields/initializer-error/cls-expr-fields-static-comp-name.template create mode 100644 src/class-fields/initializer-error/cls-expr-fields-static-literal-name.template create mode 100644 src/class-fields/initializer-error/cls-expr-fields-static-string-literal-name.template create mode 100644 src/class-fields/initializer-error/cls-expr-fields-string-literal-name.template create mode 100644 src/class-fields/initializer-error/cls-expr-fields-ternary.template create mode 100644 src/class-fields/initializer-error/cls-expr-fields-typeof.template diff --git a/src/class-fields/init-err-contains-boolean.case b/src/class-fields/init-err-contains-boolean.case new file mode 100644 index 0000000000..605cdd32dd --- /dev/null +++ b/src/class-fields/init-err-contains-boolean.case @@ -0,0 +1,28 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Syntax error if `arguments` used in class field +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if ContainsArguments of Initializer is true. + + Static Semantics: ContainsArguments + IdentifierReference : Identifier + + 1. If the StringValue of Identifier is "arguments", return true. + ... + For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. +features: [class-fields] +negative: + type: SyntaxError + phase: early +template: initializer-error +---*/ + +//- initializer +arguments diff --git a/src/class-fields/init-err-contains-super.case b/src/class-fields/init-err-contains-super.case new file mode 100644 index 0000000000..49aa3c9bff --- /dev/null +++ b/src/class-fields/init-err-contains-super.case @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Syntax error if `super()` used in class field +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true. +features: [class-fields] +negative: + type: SyntaxError + phase: early +template: initializer-error +---*/ + +//- initializer +super() diff --git a/src/class-fields/initializer-error/cls-decl-fields-arrow-fnc.template b/src/class-fields/initializer-error/cls-decl-fields-arrow-fnc.template new file mode 100644 index 0000000000..308297a34a --- /dev/null +++ b/src/class-fields/initializer-error/cls-decl-fields-arrow-fnc.template @@ -0,0 +1,15 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-class-definitions-static-semantics-early-errors +path: language/statements/class/fields-arrow-fnc- +name: arrow function expression +features: [arrow-function] +---*/ + +throw "Test262: This statement should not be evaluated."; + +class C { + x = () => /*{ initializer }*/; +} diff --git a/src/class-fields/initializer-error/cls-decl-fields-comp-name.template b/src/class-fields/initializer-error/cls-decl-fields-comp-name.template new file mode 100644 index 0000000000..a922c25b80 --- /dev/null +++ b/src/class-fields/initializer-error/cls-decl-fields-comp-name.template @@ -0,0 +1,15 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-class-definitions-static-semantics-early-errors +path: language/statements/class/fields-comp-name- +name: computed ClassElementName +---*/ + +throw "Test262: This statement should not be evaluated."; + +var x = "string"; +class C { + static [x] = /*{ initializer }*/; +} diff --git a/src/class-fields/initializer-error/cls-decl-fields-equality.template b/src/class-fields/initializer-error/cls-decl-fields-equality.template new file mode 100644 index 0000000000..0e5b643e11 --- /dev/null +++ b/src/class-fields/initializer-error/cls-decl-fields-equality.template @@ -0,0 +1,14 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-class-definitions-static-semantics-early-errors +path: language/statements/class/fields-equality- +name: equality expression +---*/ + +throw "Test262: This statement should not be evaluated."; + +class C { + x = {} == /*{ initializer }*/; +} diff --git a/src/class-fields/initializer-error/cls-decl-fields-literal-name.template b/src/class-fields/initializer-error/cls-decl-fields-literal-name.template new file mode 100644 index 0000000000..62060229fa --- /dev/null +++ b/src/class-fields/initializer-error/cls-decl-fields-literal-name.template @@ -0,0 +1,14 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-class-definitions-static-semantics-early-errors +path: language/statements/class/fields-literal-name- +name: literal ClassElementName +---*/ + +throw "Test262: This statement should not be evaluated."; + +class C { + x = /*{ initializer }*/; +} diff --git a/src/class-fields/initializer-error/cls-decl-fields-static-comp-name.template b/src/class-fields/initializer-error/cls-decl-fields-static-comp-name.template new file mode 100644 index 0000000000..b4eb238479 --- /dev/null +++ b/src/class-fields/initializer-error/cls-decl-fields-static-comp-name.template @@ -0,0 +1,15 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-class-definitions-static-semantics-early-errors +path: language/statements/class/fields-static-comp-name- +name: static computed ClassElementName +---*/ + +throw "Test262: This statement should not be evaluated."; + +var x = "string"; +class C { + static [x] = /*{ initializer }*/; +} diff --git a/src/class-fields/initializer-error/cls-decl-fields-static-literal-name.template b/src/class-fields/initializer-error/cls-decl-fields-static-literal-name.template new file mode 100644 index 0000000000..335d76793f --- /dev/null +++ b/src/class-fields/initializer-error/cls-decl-fields-static-literal-name.template @@ -0,0 +1,14 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-class-definitions-static-semantics-early-errors +path: language/statements/class/fields-static-literal- +name: static literal ClassElementName +---*/ + +throw "Test262: This statement should not be evaluated."; + +class C { + static x = /*{ initializer }*/; +} diff --git a/src/class-fields/initializer-error/cls-decl-fields-static-string-literal-name.template b/src/class-fields/initializer-error/cls-decl-fields-static-string-literal-name.template new file mode 100644 index 0000000000..5fd801e187 --- /dev/null +++ b/src/class-fields/initializer-error/cls-decl-fields-static-string-literal-name.template @@ -0,0 +1,14 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-class-definitions-static-semantics-early-errors +path: language/statements/class/fields-static-string-literal-name- +name: static string literal ClassElementName +---*/ + +throw "Test262: This statement should not be evaluated."; + +class C { + static 'x' = /*{ initializer }*/; +} diff --git a/src/class-fields/initializer-error/cls-decl-fields-string-literal-name.template b/src/class-fields/initializer-error/cls-decl-fields-string-literal-name.template new file mode 100644 index 0000000000..b76e487109 --- /dev/null +++ b/src/class-fields/initializer-error/cls-decl-fields-string-literal-name.template @@ -0,0 +1,14 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-class-definitions-static-semantics-early-errors +path: language/statements/class/fields-string-literal-name- +name: string literal ClassElementName +---*/ + +throw "Test262: This statement should not be evaluated."; + +class C { + 'x' = /*{ initializer }*/; +} diff --git a/src/class-fields/initializer-error/cls-decl-fields-ternary.template b/src/class-fields/initializer-error/cls-decl-fields-ternary.template new file mode 100644 index 0000000000..db729e59c8 --- /dev/null +++ b/src/class-fields/initializer-error/cls-decl-fields-ternary.template @@ -0,0 +1,14 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-class-definitions-static-semantics-early-errors +path: language/statements/class/fields-ternary- +name: ternary expression +---*/ + +throw "Test262: This statement should not be evaluated."; + +class C { + x = false ? {} : /*{ initializer }*/; +} diff --git a/src/class-fields/initializer-error/cls-decl-fields-typeof.template b/src/class-fields/initializer-error/cls-decl-fields-typeof.template new file mode 100644 index 0000000000..86f5598b3b --- /dev/null +++ b/src/class-fields/initializer-error/cls-decl-fields-typeof.template @@ -0,0 +1,14 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-class-definitions-static-semantics-early-errors +path: language/statements/class/fields-typeof- +name: typeof expression +---*/ + +throw "Test262: This statement should not be evaluated."; + +class C { + x = typeof /*{ initializer }*/; +} diff --git a/src/class-fields/initializer-error/cls-expr-fields-arrow-fnc.template b/src/class-fields/initializer-error/cls-expr-fields-arrow-fnc.template new file mode 100644 index 0000000000..0f20b4d9f8 --- /dev/null +++ b/src/class-fields/initializer-error/cls-expr-fields-arrow-fnc.template @@ -0,0 +1,15 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-class-definitions-static-semantics-early-errors +path: language/expressions/class/fields-arrow-fnc- +name: arrow function expression +features: [arrow-function] +---*/ + +throw "Test262: This statement should not be evaluated."; + +var C = class { + x = () => /*{ initializer }*/; +} diff --git a/src/class-fields/initializer-error/cls-expr-fields-comp-name.template b/src/class-fields/initializer-error/cls-expr-fields-comp-name.template new file mode 100644 index 0000000000..fea438412f --- /dev/null +++ b/src/class-fields/initializer-error/cls-expr-fields-comp-name.template @@ -0,0 +1,15 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-class-definitions-static-semantics-early-errors +path: language/expressions/class/fields-comp-name- +name: computed ClassElementName +---*/ + +throw "Test262: This statement should not be evaluated."; + +var x = "string"; +var C = class { + [x] = /*{ initializer }*/; +} diff --git a/src/class-fields/initializer-error/cls-expr-fields-equality.template b/src/class-fields/initializer-error/cls-expr-fields-equality.template new file mode 100644 index 0000000000..2946f8004d --- /dev/null +++ b/src/class-fields/initializer-error/cls-expr-fields-equality.template @@ -0,0 +1,14 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-class-definitions-static-semantics-early-errors +path: language/expressions/class/fields-equality- +name: equality expression +---*/ + +throw "Test262: This statement should not be evaluated."; + +var C = class { + x = {} == /*{ initializer }*/; +} diff --git a/src/class-fields/initializer-error/cls-expr-fields-literal-name.template b/src/class-fields/initializer-error/cls-expr-fields-literal-name.template new file mode 100644 index 0000000000..891e285274 --- /dev/null +++ b/src/class-fields/initializer-error/cls-expr-fields-literal-name.template @@ -0,0 +1,14 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-class-definitions-static-semantics-early-errors +path: language/expressions/class/fields-literal-name- +name: literal ClassElementName +---*/ + +throw "Test262: This statement should not be evaluated."; + +var C = class { + x = /*{ initializer }*/; +} diff --git a/src/class-fields/initializer-error/cls-expr-fields-static-comp-name.template b/src/class-fields/initializer-error/cls-expr-fields-static-comp-name.template new file mode 100644 index 0000000000..cb44207f4e --- /dev/null +++ b/src/class-fields/initializer-error/cls-expr-fields-static-comp-name.template @@ -0,0 +1,15 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-class-definitions-static-semantics-early-errors +path: language/expressions/class/fields-static-comp-name- +name: static computed ClassElementName +---*/ + +throw "Test262: This statement should not be evaluated."; + +var x = "string"; +var C = class { + static [x] = /*{ initializer }*/; +} diff --git a/src/class-fields/initializer-error/cls-expr-fields-static-literal-name.template b/src/class-fields/initializer-error/cls-expr-fields-static-literal-name.template new file mode 100644 index 0000000000..0a840e01ef --- /dev/null +++ b/src/class-fields/initializer-error/cls-expr-fields-static-literal-name.template @@ -0,0 +1,14 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-class-definitions-static-semantics-early-errors +path: language/expressions/class/fields-static-literal- +name: static literal ClassElementName +---*/ + +throw "Test262: This statement should not be evaluated."; + +var C = class { + static x = /*{ initializer }*/; +} diff --git a/src/class-fields/initializer-error/cls-expr-fields-static-string-literal-name.template b/src/class-fields/initializer-error/cls-expr-fields-static-string-literal-name.template new file mode 100644 index 0000000000..deed9b15e3 --- /dev/null +++ b/src/class-fields/initializer-error/cls-expr-fields-static-string-literal-name.template @@ -0,0 +1,14 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-class-definitions-static-semantics-early-errors +path: language/expressions/class/fields-static-string-literal-name- +name: static string literal ClassElementName +---*/ + +throw "Test262: This statement should not be evaluated."; + +var C = class { + static 'x' = /*{ initializer }*/; +} diff --git a/src/class-fields/initializer-error/cls-expr-fields-string-literal-name.template b/src/class-fields/initializer-error/cls-expr-fields-string-literal-name.template new file mode 100644 index 0000000000..1325036c0c --- /dev/null +++ b/src/class-fields/initializer-error/cls-expr-fields-string-literal-name.template @@ -0,0 +1,14 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-class-definitions-static-semantics-early-errors +path: language/expressions/class/fields-string-literal-name- +name: string literal ClassElementName +---*/ + +throw "Test262: This statement should not be evaluated."; + +var C = class { + 'x' = /*{ initializer }*/; +} diff --git a/src/class-fields/initializer-error/cls-expr-fields-ternary.template b/src/class-fields/initializer-error/cls-expr-fields-ternary.template new file mode 100644 index 0000000000..8dd67bed29 --- /dev/null +++ b/src/class-fields/initializer-error/cls-expr-fields-ternary.template @@ -0,0 +1,14 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-class-definitions-static-semantics-early-errors +path: language/expressions/class/fields-ternary- +name: ternary expression +---*/ + +throw "Test262: This statement should not be evaluated."; + +var C = class { + x = true ? {} : /*{ initializer }*/; +} diff --git a/src/class-fields/initializer-error/cls-expr-fields-typeof.template b/src/class-fields/initializer-error/cls-expr-fields-typeof.template new file mode 100644 index 0000000000..ec75561623 --- /dev/null +++ b/src/class-fields/initializer-error/cls-expr-fields-typeof.template @@ -0,0 +1,14 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-class-definitions-static-semantics-early-errors +path: language/expressions/class/fields-typeof- +name: typeof expression +---*/ + +throw "Test262: This statement should not be evaluated."; + +var C = class { + x = typeof /*{ initializer }*/; +} From d3c7e1a13a82f6808cb65edf5099e75409fe0f03 Mon Sep 17 00:00:00 2001 From: Valerie R Young Date: Tue, 17 Oct 2017 17:51:13 -0400 Subject: [PATCH 2/2] generate files --- ...lds-arrow-fnc-init-err-contains-boolean.js | 34 ++++++++++++++++++ ...ields-arrow-fnc-init-err-contains-super.js | 27 ++++++++++++++ ...lds-comp-name-init-err-contains-boolean.js | 35 +++++++++++++++++++ ...ields-comp-name-init-err-contains-super.js | 28 +++++++++++++++ ...elds-equality-init-err-contains-boolean.js | 34 ++++++++++++++++++ ...fields-equality-init-err-contains-super.js | 27 ++++++++++++++ ...-literal-name-init-err-contains-boolean.js | 34 ++++++++++++++++++ ...ds-literal-name-init-err-contains-super.js | 27 ++++++++++++++ ...tic-comp-name-init-err-contains-boolean.js | 35 +++++++++++++++++++ ...tatic-comp-name-init-err-contains-super.js | 28 +++++++++++++++ ...tatic-literal-init-err-contains-boolean.js | 34 ++++++++++++++++++ ...-static-literal-init-err-contains-super.js | 27 ++++++++++++++ ...-literal-name-init-err-contains-boolean.js | 34 ++++++++++++++++++ ...ng-literal-name-init-err-contains-super.js | 27 ++++++++++++++ ...-literal-name-init-err-contains-boolean.js | 34 ++++++++++++++++++ ...ng-literal-name-init-err-contains-super.js | 27 ++++++++++++++ ...ields-ternary-init-err-contains-boolean.js | 34 ++++++++++++++++++ .../fields-ternary-init-err-contains-super.js | 27 ++++++++++++++ ...fields-typeof-init-err-contains-boolean.js | 34 ++++++++++++++++++ .../fields-typeof-init-err-contains-super.js | 27 ++++++++++++++ ...lds-arrow-fnc-init-err-contains-boolean.js | 34 ++++++++++++++++++ ...ields-arrow-fnc-init-err-contains-super.js | 27 ++++++++++++++ ...lds-comp-name-init-err-contains-boolean.js | 35 +++++++++++++++++++ ...ields-comp-name-init-err-contains-super.js | 28 +++++++++++++++ ...elds-equality-init-err-contains-boolean.js | 34 ++++++++++++++++++ ...fields-equality-init-err-contains-super.js | 27 ++++++++++++++ ...-literal-name-init-err-contains-boolean.js | 34 ++++++++++++++++++ ...ds-literal-name-init-err-contains-super.js | 27 ++++++++++++++ ...tic-comp-name-init-err-contains-boolean.js | 35 +++++++++++++++++++ ...tatic-comp-name-init-err-contains-super.js | 28 +++++++++++++++ ...tatic-literal-init-err-contains-boolean.js | 34 ++++++++++++++++++ ...-static-literal-init-err-contains-super.js | 27 ++++++++++++++ ...-literal-name-init-err-contains-boolean.js | 34 ++++++++++++++++++ ...ng-literal-name-init-err-contains-super.js | 27 ++++++++++++++ ...-literal-name-init-err-contains-boolean.js | 34 ++++++++++++++++++ ...ng-literal-name-init-err-contains-super.js | 27 ++++++++++++++ ...ields-ternary-init-err-contains-boolean.js | 34 ++++++++++++++++++ .../fields-ternary-init-err-contains-super.js | 27 ++++++++++++++ ...fields-typeof-init-err-contains-boolean.js | 34 ++++++++++++++++++ .../fields-typeof-init-err-contains-super.js | 27 ++++++++++++++ 40 files changed, 1228 insertions(+) create mode 100644 test/language/expressions/class/fields-arrow-fnc-init-err-contains-boolean.js create mode 100644 test/language/expressions/class/fields-arrow-fnc-init-err-contains-super.js create mode 100644 test/language/expressions/class/fields-comp-name-init-err-contains-boolean.js create mode 100644 test/language/expressions/class/fields-comp-name-init-err-contains-super.js create mode 100644 test/language/expressions/class/fields-equality-init-err-contains-boolean.js create mode 100644 test/language/expressions/class/fields-equality-init-err-contains-super.js create mode 100644 test/language/expressions/class/fields-literal-name-init-err-contains-boolean.js create mode 100644 test/language/expressions/class/fields-literal-name-init-err-contains-super.js create mode 100644 test/language/expressions/class/fields-static-comp-name-init-err-contains-boolean.js create mode 100644 test/language/expressions/class/fields-static-comp-name-init-err-contains-super.js create mode 100644 test/language/expressions/class/fields-static-literal-init-err-contains-boolean.js create mode 100644 test/language/expressions/class/fields-static-literal-init-err-contains-super.js create mode 100644 test/language/expressions/class/fields-static-string-literal-name-init-err-contains-boolean.js create mode 100644 test/language/expressions/class/fields-static-string-literal-name-init-err-contains-super.js create mode 100644 test/language/expressions/class/fields-string-literal-name-init-err-contains-boolean.js create mode 100644 test/language/expressions/class/fields-string-literal-name-init-err-contains-super.js create mode 100644 test/language/expressions/class/fields-ternary-init-err-contains-boolean.js create mode 100644 test/language/expressions/class/fields-ternary-init-err-contains-super.js create mode 100644 test/language/expressions/class/fields-typeof-init-err-contains-boolean.js create mode 100644 test/language/expressions/class/fields-typeof-init-err-contains-super.js create mode 100644 test/language/statements/class/fields-arrow-fnc-init-err-contains-boolean.js create mode 100644 test/language/statements/class/fields-arrow-fnc-init-err-contains-super.js create mode 100644 test/language/statements/class/fields-comp-name-init-err-contains-boolean.js create mode 100644 test/language/statements/class/fields-comp-name-init-err-contains-super.js create mode 100644 test/language/statements/class/fields-equality-init-err-contains-boolean.js create mode 100644 test/language/statements/class/fields-equality-init-err-contains-super.js create mode 100644 test/language/statements/class/fields-literal-name-init-err-contains-boolean.js create mode 100644 test/language/statements/class/fields-literal-name-init-err-contains-super.js create mode 100644 test/language/statements/class/fields-static-comp-name-init-err-contains-boolean.js create mode 100644 test/language/statements/class/fields-static-comp-name-init-err-contains-super.js create mode 100644 test/language/statements/class/fields-static-literal-init-err-contains-boolean.js create mode 100644 test/language/statements/class/fields-static-literal-init-err-contains-super.js create mode 100644 test/language/statements/class/fields-static-string-literal-name-init-err-contains-boolean.js create mode 100644 test/language/statements/class/fields-static-string-literal-name-init-err-contains-super.js create mode 100644 test/language/statements/class/fields-string-literal-name-init-err-contains-boolean.js create mode 100644 test/language/statements/class/fields-string-literal-name-init-err-contains-super.js create mode 100644 test/language/statements/class/fields-ternary-init-err-contains-boolean.js create mode 100644 test/language/statements/class/fields-ternary-init-err-contains-super.js create mode 100644 test/language/statements/class/fields-typeof-init-err-contains-boolean.js create mode 100644 test/language/statements/class/fields-typeof-init-err-contains-super.js diff --git a/test/language/expressions/class/fields-arrow-fnc-init-err-contains-boolean.js b/test/language/expressions/class/fields-arrow-fnc-init-err-contains-boolean.js new file mode 100644 index 0000000000..9fc6f0ff5e --- /dev/null +++ b/test/language/expressions/class/fields-arrow-fnc-init-err-contains-boolean.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-boolean.case +// - src/class-fields/initializer-error/cls-expr-fields-arrow-fnc.template +/*--- +description: Syntax error if `arguments` used in class field (arrow function expression) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields, arrow-function] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if ContainsArguments of Initializer is true. + + Static Semantics: ContainsArguments + IdentifierReference : Identifier + + 1. If the StringValue of Identifier is "arguments", return true. + ... + For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + x = () => arguments; +} diff --git a/test/language/expressions/class/fields-arrow-fnc-init-err-contains-super.js b/test/language/expressions/class/fields-arrow-fnc-init-err-contains-super.js new file mode 100644 index 0000000000..b746929920 --- /dev/null +++ b/test/language/expressions/class/fields-arrow-fnc-init-err-contains-super.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-super.case +// - src/class-fields/initializer-error/cls-expr-fields-arrow-fnc.template +/*--- +description: Syntax error if `super()` used in class field (arrow function expression) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields, arrow-function] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + x = () => super(); +} diff --git a/test/language/expressions/class/fields-comp-name-init-err-contains-boolean.js b/test/language/expressions/class/fields-comp-name-init-err-contains-boolean.js new file mode 100644 index 0000000000..0feb910d79 --- /dev/null +++ b/test/language/expressions/class/fields-comp-name-init-err-contains-boolean.js @@ -0,0 +1,35 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-boolean.case +// - src/class-fields/initializer-error/cls-expr-fields-comp-name.template +/*--- +description: Syntax error if `arguments` used in class field (computed ClassElementName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if ContainsArguments of Initializer is true. + + Static Semantics: ContainsArguments + IdentifierReference : Identifier + + 1. If the StringValue of Identifier is "arguments", return true. + ... + For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var x = "string"; +var C = class { + [x] = arguments; +} diff --git a/test/language/expressions/class/fields-comp-name-init-err-contains-super.js b/test/language/expressions/class/fields-comp-name-init-err-contains-super.js new file mode 100644 index 0000000000..b3716d81f6 --- /dev/null +++ b/test/language/expressions/class/fields-comp-name-init-err-contains-super.js @@ -0,0 +1,28 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-super.case +// - src/class-fields/initializer-error/cls-expr-fields-comp-name.template +/*--- +description: Syntax error if `super()` used in class field (computed ClassElementName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var x = "string"; +var C = class { + [x] = super(); +} diff --git a/test/language/expressions/class/fields-equality-init-err-contains-boolean.js b/test/language/expressions/class/fields-equality-init-err-contains-boolean.js new file mode 100644 index 0000000000..16f6f86668 --- /dev/null +++ b/test/language/expressions/class/fields-equality-init-err-contains-boolean.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-boolean.case +// - src/class-fields/initializer-error/cls-expr-fields-equality.template +/*--- +description: Syntax error if `arguments` used in class field (equality expression) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if ContainsArguments of Initializer is true. + + Static Semantics: ContainsArguments + IdentifierReference : Identifier + + 1. If the StringValue of Identifier is "arguments", return true. + ... + For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + x = {} == arguments; +} diff --git a/test/language/expressions/class/fields-equality-init-err-contains-super.js b/test/language/expressions/class/fields-equality-init-err-contains-super.js new file mode 100644 index 0000000000..356043abff --- /dev/null +++ b/test/language/expressions/class/fields-equality-init-err-contains-super.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-super.case +// - src/class-fields/initializer-error/cls-expr-fields-equality.template +/*--- +description: Syntax error if `super()` used in class field (equality expression) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + x = {} == super(); +} diff --git a/test/language/expressions/class/fields-literal-name-init-err-contains-boolean.js b/test/language/expressions/class/fields-literal-name-init-err-contains-boolean.js new file mode 100644 index 0000000000..f876b3f123 --- /dev/null +++ b/test/language/expressions/class/fields-literal-name-init-err-contains-boolean.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-boolean.case +// - src/class-fields/initializer-error/cls-expr-fields-literal-name.template +/*--- +description: Syntax error if `arguments` used in class field (literal ClassElementName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if ContainsArguments of Initializer is true. + + Static Semantics: ContainsArguments + IdentifierReference : Identifier + + 1. If the StringValue of Identifier is "arguments", return true. + ... + For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + x = arguments; +} diff --git a/test/language/expressions/class/fields-literal-name-init-err-contains-super.js b/test/language/expressions/class/fields-literal-name-init-err-contains-super.js new file mode 100644 index 0000000000..ea7f5af0ae --- /dev/null +++ b/test/language/expressions/class/fields-literal-name-init-err-contains-super.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-super.case +// - src/class-fields/initializer-error/cls-expr-fields-literal-name.template +/*--- +description: Syntax error if `super()` used in class field (literal ClassElementName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + x = super(); +} diff --git a/test/language/expressions/class/fields-static-comp-name-init-err-contains-boolean.js b/test/language/expressions/class/fields-static-comp-name-init-err-contains-boolean.js new file mode 100644 index 0000000000..067fd7e556 --- /dev/null +++ b/test/language/expressions/class/fields-static-comp-name-init-err-contains-boolean.js @@ -0,0 +1,35 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-boolean.case +// - src/class-fields/initializer-error/cls-expr-fields-static-comp-name.template +/*--- +description: Syntax error if `arguments` used in class field (static computed ClassElementName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if ContainsArguments of Initializer is true. + + Static Semantics: ContainsArguments + IdentifierReference : Identifier + + 1. If the StringValue of Identifier is "arguments", return true. + ... + For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var x = "string"; +var C = class { + static [x] = arguments; +} diff --git a/test/language/expressions/class/fields-static-comp-name-init-err-contains-super.js b/test/language/expressions/class/fields-static-comp-name-init-err-contains-super.js new file mode 100644 index 0000000000..8869bc253c --- /dev/null +++ b/test/language/expressions/class/fields-static-comp-name-init-err-contains-super.js @@ -0,0 +1,28 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-super.case +// - src/class-fields/initializer-error/cls-expr-fields-static-comp-name.template +/*--- +description: Syntax error if `super()` used in class field (static computed ClassElementName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var x = "string"; +var C = class { + static [x] = super(); +} diff --git a/test/language/expressions/class/fields-static-literal-init-err-contains-boolean.js b/test/language/expressions/class/fields-static-literal-init-err-contains-boolean.js new file mode 100644 index 0000000000..a7a0b9b030 --- /dev/null +++ b/test/language/expressions/class/fields-static-literal-init-err-contains-boolean.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-boolean.case +// - src/class-fields/initializer-error/cls-expr-fields-static-literal-name.template +/*--- +description: Syntax error if `arguments` used in class field (static literal ClassElementName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if ContainsArguments of Initializer is true. + + Static Semantics: ContainsArguments + IdentifierReference : Identifier + + 1. If the StringValue of Identifier is "arguments", return true. + ... + For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + static x = arguments; +} diff --git a/test/language/expressions/class/fields-static-literal-init-err-contains-super.js b/test/language/expressions/class/fields-static-literal-init-err-contains-super.js new file mode 100644 index 0000000000..3d2bcd3985 --- /dev/null +++ b/test/language/expressions/class/fields-static-literal-init-err-contains-super.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-super.case +// - src/class-fields/initializer-error/cls-expr-fields-static-literal-name.template +/*--- +description: Syntax error if `super()` used in class field (static literal ClassElementName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + static x = super(); +} diff --git a/test/language/expressions/class/fields-static-string-literal-name-init-err-contains-boolean.js b/test/language/expressions/class/fields-static-string-literal-name-init-err-contains-boolean.js new file mode 100644 index 0000000000..e3027d802d --- /dev/null +++ b/test/language/expressions/class/fields-static-string-literal-name-init-err-contains-boolean.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-boolean.case +// - src/class-fields/initializer-error/cls-expr-fields-static-string-literal-name.template +/*--- +description: Syntax error if `arguments` used in class field (static string literal ClassElementName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if ContainsArguments of Initializer is true. + + Static Semantics: ContainsArguments + IdentifierReference : Identifier + + 1. If the StringValue of Identifier is "arguments", return true. + ... + For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + static 'x' = arguments; +} diff --git a/test/language/expressions/class/fields-static-string-literal-name-init-err-contains-super.js b/test/language/expressions/class/fields-static-string-literal-name-init-err-contains-super.js new file mode 100644 index 0000000000..5ec19a80c6 --- /dev/null +++ b/test/language/expressions/class/fields-static-string-literal-name-init-err-contains-super.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-super.case +// - src/class-fields/initializer-error/cls-expr-fields-static-string-literal-name.template +/*--- +description: Syntax error if `super()` used in class field (static string literal ClassElementName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + static 'x' = super(); +} diff --git a/test/language/expressions/class/fields-string-literal-name-init-err-contains-boolean.js b/test/language/expressions/class/fields-string-literal-name-init-err-contains-boolean.js new file mode 100644 index 0000000000..1fd354365a --- /dev/null +++ b/test/language/expressions/class/fields-string-literal-name-init-err-contains-boolean.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-boolean.case +// - src/class-fields/initializer-error/cls-expr-fields-string-literal-name.template +/*--- +description: Syntax error if `arguments` used in class field (string literal ClassElementName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if ContainsArguments of Initializer is true. + + Static Semantics: ContainsArguments + IdentifierReference : Identifier + + 1. If the StringValue of Identifier is "arguments", return true. + ... + For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + 'x' = arguments; +} diff --git a/test/language/expressions/class/fields-string-literal-name-init-err-contains-super.js b/test/language/expressions/class/fields-string-literal-name-init-err-contains-super.js new file mode 100644 index 0000000000..90dbfc87e9 --- /dev/null +++ b/test/language/expressions/class/fields-string-literal-name-init-err-contains-super.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-super.case +// - src/class-fields/initializer-error/cls-expr-fields-string-literal-name.template +/*--- +description: Syntax error if `super()` used in class field (string literal ClassElementName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + 'x' = super(); +} diff --git a/test/language/expressions/class/fields-ternary-init-err-contains-boolean.js b/test/language/expressions/class/fields-ternary-init-err-contains-boolean.js new file mode 100644 index 0000000000..b6bea67105 --- /dev/null +++ b/test/language/expressions/class/fields-ternary-init-err-contains-boolean.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-boolean.case +// - src/class-fields/initializer-error/cls-expr-fields-ternary.template +/*--- +description: Syntax error if `arguments` used in class field (ternary expression) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if ContainsArguments of Initializer is true. + + Static Semantics: ContainsArguments + IdentifierReference : Identifier + + 1. If the StringValue of Identifier is "arguments", return true. + ... + For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + x = true ? {} : arguments; +} diff --git a/test/language/expressions/class/fields-ternary-init-err-contains-super.js b/test/language/expressions/class/fields-ternary-init-err-contains-super.js new file mode 100644 index 0000000000..7ecd82fe25 --- /dev/null +++ b/test/language/expressions/class/fields-ternary-init-err-contains-super.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-super.case +// - src/class-fields/initializer-error/cls-expr-fields-ternary.template +/*--- +description: Syntax error if `super()` used in class field (ternary expression) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + x = true ? {} : super(); +} diff --git a/test/language/expressions/class/fields-typeof-init-err-contains-boolean.js b/test/language/expressions/class/fields-typeof-init-err-contains-boolean.js new file mode 100644 index 0000000000..7e40384075 --- /dev/null +++ b/test/language/expressions/class/fields-typeof-init-err-contains-boolean.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-boolean.case +// - src/class-fields/initializer-error/cls-expr-fields-typeof.template +/*--- +description: Syntax error if `arguments` used in class field (typeof expression) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if ContainsArguments of Initializer is true. + + Static Semantics: ContainsArguments + IdentifierReference : Identifier + + 1. If the StringValue of Identifier is "arguments", return true. + ... + For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + x = typeof arguments; +} diff --git a/test/language/expressions/class/fields-typeof-init-err-contains-super.js b/test/language/expressions/class/fields-typeof-init-err-contains-super.js new file mode 100644 index 0000000000..0ad4a74ebb --- /dev/null +++ b/test/language/expressions/class/fields-typeof-init-err-contains-super.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-super.case +// - src/class-fields/initializer-error/cls-expr-fields-typeof.template +/*--- +description: Syntax error if `super()` used in class field (typeof expression) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + x = typeof super(); +} diff --git a/test/language/statements/class/fields-arrow-fnc-init-err-contains-boolean.js b/test/language/statements/class/fields-arrow-fnc-init-err-contains-boolean.js new file mode 100644 index 0000000000..a234a89f58 --- /dev/null +++ b/test/language/statements/class/fields-arrow-fnc-init-err-contains-boolean.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-boolean.case +// - src/class-fields/initializer-error/cls-decl-fields-arrow-fnc.template +/*--- +description: Syntax error if `arguments` used in class field (arrow function expression) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields, arrow-function] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if ContainsArguments of Initializer is true. + + Static Semantics: ContainsArguments + IdentifierReference : Identifier + + 1. If the StringValue of Identifier is "arguments", return true. + ... + For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + x = () => arguments; +} diff --git a/test/language/statements/class/fields-arrow-fnc-init-err-contains-super.js b/test/language/statements/class/fields-arrow-fnc-init-err-contains-super.js new file mode 100644 index 0000000000..e1f0941e03 --- /dev/null +++ b/test/language/statements/class/fields-arrow-fnc-init-err-contains-super.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-super.case +// - src/class-fields/initializer-error/cls-decl-fields-arrow-fnc.template +/*--- +description: Syntax error if `super()` used in class field (arrow function expression) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields, arrow-function] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + x = () => super(); +} diff --git a/test/language/statements/class/fields-comp-name-init-err-contains-boolean.js b/test/language/statements/class/fields-comp-name-init-err-contains-boolean.js new file mode 100644 index 0000000000..ce800b3ba6 --- /dev/null +++ b/test/language/statements/class/fields-comp-name-init-err-contains-boolean.js @@ -0,0 +1,35 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-boolean.case +// - src/class-fields/initializer-error/cls-decl-fields-comp-name.template +/*--- +description: Syntax error if `arguments` used in class field (computed ClassElementName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if ContainsArguments of Initializer is true. + + Static Semantics: ContainsArguments + IdentifierReference : Identifier + + 1. If the StringValue of Identifier is "arguments", return true. + ... + For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var x = "string"; +class C { + static [x] = arguments; +} diff --git a/test/language/statements/class/fields-comp-name-init-err-contains-super.js b/test/language/statements/class/fields-comp-name-init-err-contains-super.js new file mode 100644 index 0000000000..7622021508 --- /dev/null +++ b/test/language/statements/class/fields-comp-name-init-err-contains-super.js @@ -0,0 +1,28 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-super.case +// - src/class-fields/initializer-error/cls-decl-fields-comp-name.template +/*--- +description: Syntax error if `super()` used in class field (computed ClassElementName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var x = "string"; +class C { + static [x] = super(); +} diff --git a/test/language/statements/class/fields-equality-init-err-contains-boolean.js b/test/language/statements/class/fields-equality-init-err-contains-boolean.js new file mode 100644 index 0000000000..2d8f85536c --- /dev/null +++ b/test/language/statements/class/fields-equality-init-err-contains-boolean.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-boolean.case +// - src/class-fields/initializer-error/cls-decl-fields-equality.template +/*--- +description: Syntax error if `arguments` used in class field (equality expression) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if ContainsArguments of Initializer is true. + + Static Semantics: ContainsArguments + IdentifierReference : Identifier + + 1. If the StringValue of Identifier is "arguments", return true. + ... + For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + x = {} == arguments; +} diff --git a/test/language/statements/class/fields-equality-init-err-contains-super.js b/test/language/statements/class/fields-equality-init-err-contains-super.js new file mode 100644 index 0000000000..32a55253c3 --- /dev/null +++ b/test/language/statements/class/fields-equality-init-err-contains-super.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-super.case +// - src/class-fields/initializer-error/cls-decl-fields-equality.template +/*--- +description: Syntax error if `super()` used in class field (equality expression) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + x = {} == super(); +} diff --git a/test/language/statements/class/fields-literal-name-init-err-contains-boolean.js b/test/language/statements/class/fields-literal-name-init-err-contains-boolean.js new file mode 100644 index 0000000000..f40f586dab --- /dev/null +++ b/test/language/statements/class/fields-literal-name-init-err-contains-boolean.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-boolean.case +// - src/class-fields/initializer-error/cls-decl-fields-literal-name.template +/*--- +description: Syntax error if `arguments` used in class field (literal ClassElementName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if ContainsArguments of Initializer is true. + + Static Semantics: ContainsArguments + IdentifierReference : Identifier + + 1. If the StringValue of Identifier is "arguments", return true. + ... + For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + x = arguments; +} diff --git a/test/language/statements/class/fields-literal-name-init-err-contains-super.js b/test/language/statements/class/fields-literal-name-init-err-contains-super.js new file mode 100644 index 0000000000..e1da665e4f --- /dev/null +++ b/test/language/statements/class/fields-literal-name-init-err-contains-super.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-super.case +// - src/class-fields/initializer-error/cls-decl-fields-literal-name.template +/*--- +description: Syntax error if `super()` used in class field (literal ClassElementName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + x = super(); +} diff --git a/test/language/statements/class/fields-static-comp-name-init-err-contains-boolean.js b/test/language/statements/class/fields-static-comp-name-init-err-contains-boolean.js new file mode 100644 index 0000000000..fcc3d58c65 --- /dev/null +++ b/test/language/statements/class/fields-static-comp-name-init-err-contains-boolean.js @@ -0,0 +1,35 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-boolean.case +// - src/class-fields/initializer-error/cls-decl-fields-static-comp-name.template +/*--- +description: Syntax error if `arguments` used in class field (static computed ClassElementName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if ContainsArguments of Initializer is true. + + Static Semantics: ContainsArguments + IdentifierReference : Identifier + + 1. If the StringValue of Identifier is "arguments", return true. + ... + For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var x = "string"; +class C { + static [x] = arguments; +} diff --git a/test/language/statements/class/fields-static-comp-name-init-err-contains-super.js b/test/language/statements/class/fields-static-comp-name-init-err-contains-super.js new file mode 100644 index 0000000000..99b7820ddf --- /dev/null +++ b/test/language/statements/class/fields-static-comp-name-init-err-contains-super.js @@ -0,0 +1,28 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-super.case +// - src/class-fields/initializer-error/cls-decl-fields-static-comp-name.template +/*--- +description: Syntax error if `super()` used in class field (static computed ClassElementName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var x = "string"; +class C { + static [x] = super(); +} diff --git a/test/language/statements/class/fields-static-literal-init-err-contains-boolean.js b/test/language/statements/class/fields-static-literal-init-err-contains-boolean.js new file mode 100644 index 0000000000..867daaeb6c --- /dev/null +++ b/test/language/statements/class/fields-static-literal-init-err-contains-boolean.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-boolean.case +// - src/class-fields/initializer-error/cls-decl-fields-static-literal-name.template +/*--- +description: Syntax error if `arguments` used in class field (static literal ClassElementName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if ContainsArguments of Initializer is true. + + Static Semantics: ContainsArguments + IdentifierReference : Identifier + + 1. If the StringValue of Identifier is "arguments", return true. + ... + For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + static x = arguments; +} diff --git a/test/language/statements/class/fields-static-literal-init-err-contains-super.js b/test/language/statements/class/fields-static-literal-init-err-contains-super.js new file mode 100644 index 0000000000..daf539141e --- /dev/null +++ b/test/language/statements/class/fields-static-literal-init-err-contains-super.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-super.case +// - src/class-fields/initializer-error/cls-decl-fields-static-literal-name.template +/*--- +description: Syntax error if `super()` used in class field (static literal ClassElementName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + static x = super(); +} diff --git a/test/language/statements/class/fields-static-string-literal-name-init-err-contains-boolean.js b/test/language/statements/class/fields-static-string-literal-name-init-err-contains-boolean.js new file mode 100644 index 0000000000..1731f8a8d4 --- /dev/null +++ b/test/language/statements/class/fields-static-string-literal-name-init-err-contains-boolean.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-boolean.case +// - src/class-fields/initializer-error/cls-decl-fields-static-string-literal-name.template +/*--- +description: Syntax error if `arguments` used in class field (static string literal ClassElementName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if ContainsArguments of Initializer is true. + + Static Semantics: ContainsArguments + IdentifierReference : Identifier + + 1. If the StringValue of Identifier is "arguments", return true. + ... + For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + static 'x' = arguments; +} diff --git a/test/language/statements/class/fields-static-string-literal-name-init-err-contains-super.js b/test/language/statements/class/fields-static-string-literal-name-init-err-contains-super.js new file mode 100644 index 0000000000..4a1f84c10b --- /dev/null +++ b/test/language/statements/class/fields-static-string-literal-name-init-err-contains-super.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-super.case +// - src/class-fields/initializer-error/cls-decl-fields-static-string-literal-name.template +/*--- +description: Syntax error if `super()` used in class field (static string literal ClassElementName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + static 'x' = super(); +} diff --git a/test/language/statements/class/fields-string-literal-name-init-err-contains-boolean.js b/test/language/statements/class/fields-string-literal-name-init-err-contains-boolean.js new file mode 100644 index 0000000000..9f5de255f3 --- /dev/null +++ b/test/language/statements/class/fields-string-literal-name-init-err-contains-boolean.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-boolean.case +// - src/class-fields/initializer-error/cls-decl-fields-string-literal-name.template +/*--- +description: Syntax error if `arguments` used in class field (string literal ClassElementName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if ContainsArguments of Initializer is true. + + Static Semantics: ContainsArguments + IdentifierReference : Identifier + + 1. If the StringValue of Identifier is "arguments", return true. + ... + For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + 'x' = arguments; +} diff --git a/test/language/statements/class/fields-string-literal-name-init-err-contains-super.js b/test/language/statements/class/fields-string-literal-name-init-err-contains-super.js new file mode 100644 index 0000000000..b92f9e8dab --- /dev/null +++ b/test/language/statements/class/fields-string-literal-name-init-err-contains-super.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-super.case +// - src/class-fields/initializer-error/cls-decl-fields-string-literal-name.template +/*--- +description: Syntax error if `super()` used in class field (string literal ClassElementName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + 'x' = super(); +} diff --git a/test/language/statements/class/fields-ternary-init-err-contains-boolean.js b/test/language/statements/class/fields-ternary-init-err-contains-boolean.js new file mode 100644 index 0000000000..45cdb53d16 --- /dev/null +++ b/test/language/statements/class/fields-ternary-init-err-contains-boolean.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-boolean.case +// - src/class-fields/initializer-error/cls-decl-fields-ternary.template +/*--- +description: Syntax error if `arguments` used in class field (ternary expression) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if ContainsArguments of Initializer is true. + + Static Semantics: ContainsArguments + IdentifierReference : Identifier + + 1. If the StringValue of Identifier is "arguments", return true. + ... + For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + x = false ? {} : arguments; +} diff --git a/test/language/statements/class/fields-ternary-init-err-contains-super.js b/test/language/statements/class/fields-ternary-init-err-contains-super.js new file mode 100644 index 0000000000..2fd60ab02a --- /dev/null +++ b/test/language/statements/class/fields-ternary-init-err-contains-super.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-super.case +// - src/class-fields/initializer-error/cls-decl-fields-ternary.template +/*--- +description: Syntax error if `super()` used in class field (ternary expression) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + x = false ? {} : super(); +} diff --git a/test/language/statements/class/fields-typeof-init-err-contains-boolean.js b/test/language/statements/class/fields-typeof-init-err-contains-boolean.js new file mode 100644 index 0000000000..54cb091677 --- /dev/null +++ b/test/language/statements/class/fields-typeof-init-err-contains-boolean.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-boolean.case +// - src/class-fields/initializer-error/cls-decl-fields-typeof.template +/*--- +description: Syntax error if `arguments` used in class field (typeof expression) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if ContainsArguments of Initializer is true. + + Static Semantics: ContainsArguments + IdentifierReference : Identifier + + 1. If the StringValue of Identifier is "arguments", return true. + ... + For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + x = typeof arguments; +} diff --git a/test/language/statements/class/fields-typeof-init-err-contains-super.js b/test/language/statements/class/fields-typeof-init-err-contains-super.js new file mode 100644 index 0000000000..71896312c1 --- /dev/null +++ b/test/language/statements/class/fields-typeof-init-err-contains-super.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-super.case +// - src/class-fields/initializer-error/cls-decl-fields-typeof.template +/*--- +description: Syntax error if `super()` used in class field (typeof expression) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + x = typeof super(); +}