Skip to content
Snippets Groups Projects
Commit f2d76e60 authored by Valerie R Young's avatar Valerie R Young Committed by Leo Balter
Browse files

class fields: add early errors for argument and super

# Conflicts:
#	src/class-fields/init-err-contains-super.case
parent 9cb6333c
No related branches found
No related tags found
No related merge requests found
// 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
// 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 }*/;
}
// 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 }*/;
}
// 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 }*/;
}
// 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 }*/;
}
// 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 }*/;
}
// 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 }*/;
}
// 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 }*/;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment