mirror of https://github.com/tc39/test262.git
Add private fields tests of early errors and small fix
This commit is contained in:
parent
f2d76e60f2
commit
ac5e65af69
|
@ -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
|
|
@ -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 }*/;
|
||||
}
|
|
@ -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 }*/;
|
||||
}
|
Loading…
Reference in New Issue