From ac5e65af6942a048aeda3c6646ed200d202f8721 Mon Sep 17 00:00:00 2001 From: Valerie R Young Date: Wed, 18 Oct 2017 15:24:39 -0400 Subject: [PATCH] Add private fields tests of early errors and small fix --- .../init-err-contains-boolean.case | 28 ------------------- ...s-decl-fields-static-private-name.template | 14 ++++++++++ ...s-expr-fields-static-private-name.template | 14 ++++++++++ 3 files changed, 28 insertions(+), 28 deletions(-) delete mode 100644 src/class-fields/init-err-contains-boolean.case create mode 100644 src/class-fields/initializer-error/cls-decl-fields-static-private-name.template create mode 100644 src/class-fields/initializer-error/cls-expr-fields-static-private-name.template diff --git a/src/class-fields/init-err-contains-boolean.case b/src/class-fields/init-err-contains-boolean.case deleted file mode 100644 index 605cdd32dd..0000000000 --- a/src/class-fields/init-err-contains-boolean.case +++ /dev/null @@ -1,28 +0,0 @@ -// 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/initializer-error/cls-decl-fields-static-private-name.template b/src/class-fields/initializer-error/cls-decl-fields-static-private-name.template new file mode 100644 index 0000000000..c50194b6a5 --- /dev/null +++ b/src/class-fields/initializer-error/cls-decl-fields-static-private-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-private- +name: static PrivateName +---*/ + +throw "Test262: This statement should not be evaluated."; + +class C { + static #x = /*{ initializer }*/; +} diff --git a/src/class-fields/initializer-error/cls-expr-fields-static-private-name.template b/src/class-fields/initializer-error/cls-expr-fields-static-private-name.template new file mode 100644 index 0000000000..0d3c770f9b --- /dev/null +++ b/src/class-fields/initializer-error/cls-expr-fields-static-private-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-private- +name: static PrivateName +---*/ + +throw "Test262: This statement should not be evaluated."; + +var C = class { + static #x = /*{ initializer }*/; +}