Add tests escaped/unescaped yield/await labels

This commit is contained in:
André Bargull 2017-05-02 12:09:30 -07:00
parent 3d8fe2af4c
commit d887db88ee
7 changed files with 98 additions and 0 deletions

View File

@ -9,3 +9,4 @@ flags: [noStrict]
---*/
label: function g() {}
label1: label2: function f() {}

View File

@ -0,0 +1,19 @@
// Copyright (C) 2017 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-identifiers-static-semantics-early-errors
description: >
`await` is a reserved identifier in module code and may not be used as a label.
info: |
Identifier : IdentifierName but not ReservedWord
It is a Syntax Error if the goal symbol of the syntactic grammar is Module and
the StringValue of IdentifierName is "await".
negative:
phase: early
type: SyntaxError
flags: [module]
---*/
aw\u0061it: 1;

View File

@ -0,0 +1,18 @@
// Copyright (C) 2017 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-identifiers-static-semantics-early-errors
description: >
`await` is a reserved identifier in module code and may not be used as a label.
info: |
LabelIdentifier : await
It is a Syntax Error if the goal symbol of the syntactic grammar is Module.
negative:
phase: early
type: SyntaxError
flags: [module]
---*/
await: 1;

View File

@ -0,0 +1,15 @@
// Copyright (C) 2017 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-identifiers-static-semantics-early-errors
description: >
`await` is not a reserved identifier in non-module code and may be used as a label.
info: |
Identifier : IdentifierName but not ReservedWord
It is a Syntax Error if the goal symbol of the syntactic grammar is Module and
the StringValue of IdentifierName is "await".
---*/
aw\u0061it: 1;

View File

@ -0,0 +1,14 @@
// Copyright (C) 2017 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-identifiers-static-semantics-early-errors
description: >
`await` is not a reserved identifier in non-module code and may be used as a label.
info: |
LabelIdentifier : await
It is a Syntax Error if the goal symbol of the syntactic grammar is Module.
---*/
await: 1;

View File

@ -0,0 +1,11 @@
// Copyright (C) 2017 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-identifiers-static-semantics-early-errors
description: >
`yield` is not a reserved identifier in non-strict mode code and may be used as a label.
flags: [noStrict]
---*/
yi\u0065ld: 1;

View File

@ -0,0 +1,20 @@
// Copyright (C) 2017 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-identifiers-static-semantics-early-errors
description: >
`yield` is a reserved identifier in strict mode code and may not be used as a label.
info: |
Identifier : IdentifierName but not ReservedWord
It is a Syntax Error if this phrase is contained in strict mode code and the
StringValue of IdentifierName is: "implements", "interface", "let", "package",
"private", "protected", "public", "static", or "yield".
negative:
phase: early
type: SyntaxError
flags: [onlyStrict]
---*/
yi\u0065ld: 1;