mirror of https://github.com/tc39/test262.git
Add lookahead restriction tests for "let [" in expression statement contexts
This commit is contained in:
parent
75d153d280
commit
7a86baee7d
|
@ -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-do-while-statement
|
||||||
|
description: >
|
||||||
|
ExpressionStatement has a lookahead restriction for `let [`.
|
||||||
|
info: |
|
||||||
|
ExpressionStatement[Yield, Await] :
|
||||||
|
[lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }]
|
||||||
|
Expression[+In, ?Yield, ?Await] ;
|
||||||
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
|
flags: [noStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
do let
|
||||||
|
[x] = 0
|
||||||
|
while (false);
|
|
@ -0,0 +1,22 @@
|
||||||
|
// Copyright (C) 2017 André Bargull. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-for-in-and-for-of-statements
|
||||||
|
description: >
|
||||||
|
ExpressionStatement has a lookahead restriction for `let [`.
|
||||||
|
info: |
|
||||||
|
ExpressionStatement[Yield, Await] :
|
||||||
|
[lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }]
|
||||||
|
Expression[+In, ?Yield, ?Await] ;
|
||||||
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
|
flags: [noStrict]
|
||||||
|
features: [async-iteration]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
async function* f() {
|
||||||
|
for await (var x of []) let
|
||||||
|
[a] = 0;
|
||||||
|
}
|
|
@ -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-for-in-and-for-of-statements
|
||||||
|
description: >
|
||||||
|
ExpressionStatement doesn't have a lookahead restriction for `let {`.
|
||||||
|
info: |
|
||||||
|
ExpressionStatement[Yield, Await] :
|
||||||
|
[lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }]
|
||||||
|
Expression[+In, ?Yield, ?Await] ;
|
||||||
|
flags: [noStrict]
|
||||||
|
features: [async-iteration]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
async function* f() {
|
||||||
|
for await (var x of []) let // ASI
|
||||||
|
{}
|
||||||
|
}
|
|
@ -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-for-in-and-for-of-statements
|
||||||
|
description: >
|
||||||
|
ExpressionStatement doesn't have a lookahead restriction for `let <binding-identifier>`.
|
||||||
|
info: |
|
||||||
|
ExpressionStatement[Yield, Await] :
|
||||||
|
[lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }]
|
||||||
|
Expression[+In, ?Yield, ?Await] ;
|
||||||
|
flags: [noStrict]
|
||||||
|
features: [async-iteration]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
async function* f() {
|
||||||
|
for await (var x of []) let // ASI
|
||||||
|
x = 1;
|
||||||
|
}
|
|
@ -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-for-in-and-for-of-statements
|
||||||
|
description: >
|
||||||
|
ExpressionStatement has a lookahead restriction for `let [`.
|
||||||
|
info: |
|
||||||
|
ExpressionStatement[Yield, Await] :
|
||||||
|
[lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }]
|
||||||
|
Expression[+In, ?Yield, ?Await] ;
|
||||||
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
|
flags: [noStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
for (var x in null) let
|
||||||
|
[a] = 0;
|
|
@ -0,0 +1,16 @@
|
||||||
|
// Copyright (C) 2017 André Bargull. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-for-in-and-for-of-statements
|
||||||
|
description: >
|
||||||
|
ExpressionStatement doesn't have a lookahead restriction for `let {`.
|
||||||
|
info: |
|
||||||
|
ExpressionStatement[Yield, Await] :
|
||||||
|
[lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }]
|
||||||
|
Expression[+In, ?Yield, ?Await] ;
|
||||||
|
flags: [noStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
for (var x in null) let // ASI
|
||||||
|
{}
|
|
@ -0,0 +1,16 @@
|
||||||
|
// Copyright (C) 2017 André Bargull. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-for-in-and-for-of-statements
|
||||||
|
description: >
|
||||||
|
ExpressionStatement doesn't have a lookahead restriction for `let <binding-identifier>`.
|
||||||
|
info: |
|
||||||
|
ExpressionStatement[Yield, Await] :
|
||||||
|
[lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }]
|
||||||
|
Expression[+In, ?Yield, ?Await] ;
|
||||||
|
flags: [noStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
for (var x in null) let // ASI
|
||||||
|
x = 1;
|
|
@ -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-for-in-and-for-of-statements
|
||||||
|
description: >
|
||||||
|
ExpressionStatement has a lookahead restriction for `let [`.
|
||||||
|
info: |
|
||||||
|
ExpressionStatement[Yield, Await] :
|
||||||
|
[lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }]
|
||||||
|
Expression[+In, ?Yield, ?Await] ;
|
||||||
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
|
flags: [noStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
for (var x of []) let
|
||||||
|
[a] = 0;
|
|
@ -0,0 +1,16 @@
|
||||||
|
// Copyright (C) 2017 André Bargull. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-for-in-and-for-of-statements
|
||||||
|
description: >
|
||||||
|
ExpressionStatement doesn't have a lookahead restriction for `let {`.
|
||||||
|
info: |
|
||||||
|
ExpressionStatement[Yield, Await] :
|
||||||
|
[lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }]
|
||||||
|
Expression[+In, ?Yield, ?Await] ;
|
||||||
|
flags: [noStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
for (var x of []) let // ASI
|
||||||
|
{}
|
|
@ -0,0 +1,16 @@
|
||||||
|
// Copyright (C) 2017 André Bargull. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-for-in-and-for-of-statements
|
||||||
|
description: >
|
||||||
|
ExpressionStatement doesn't have a lookahead restriction for `let <binding-identifier>`.
|
||||||
|
info: |
|
||||||
|
ExpressionStatement[Yield, Await] :
|
||||||
|
[lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }]
|
||||||
|
Expression[+In, ?Yield, ?Await] ;
|
||||||
|
flags: [noStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
for (var x of []) let // ASI
|
||||||
|
x = 1;
|
|
@ -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-for-statement
|
||||||
|
description: >
|
||||||
|
ExpressionStatement has a lookahead restriction for `let [`.
|
||||||
|
info: |
|
||||||
|
ExpressionStatement[Yield, Await] :
|
||||||
|
[lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }]
|
||||||
|
Expression[+In, ?Yield, ?Await] ;
|
||||||
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
|
flags: [noStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
for (; false; ) let
|
||||||
|
[a] = 0;
|
|
@ -0,0 +1,16 @@
|
||||||
|
// Copyright (C) 2017 André Bargull. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-for-statement
|
||||||
|
description: >
|
||||||
|
ExpressionStatement doesn't have a lookahead restriction for `let {`.
|
||||||
|
info: |
|
||||||
|
ExpressionStatement[Yield, Await] :
|
||||||
|
[lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }]
|
||||||
|
Expression[+In, ?Yield, ?Await] ;
|
||||||
|
flags: [noStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
for (; false; ) let // ASI
|
||||||
|
{}
|
|
@ -0,0 +1,16 @@
|
||||||
|
// Copyright (C) 2017 André Bargull. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-for-statement
|
||||||
|
description: >
|
||||||
|
ExpressionStatement doesn't have a lookahead restriction for `let <binding-identifier>`.
|
||||||
|
info: |
|
||||||
|
ExpressionStatement[Yield, Await] :
|
||||||
|
[lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }]
|
||||||
|
Expression[+In, ?Yield, ?Await] ;
|
||||||
|
flags: [noStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
for (; false; ) let // ASI
|
||||||
|
x = 1;
|
|
@ -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-if-statement
|
||||||
|
description: >
|
||||||
|
ExpressionStatement has a lookahead restriction for `let [`.
|
||||||
|
info: |
|
||||||
|
ExpressionStatement[Yield, Await] :
|
||||||
|
[lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }]
|
||||||
|
Expression[+In, ?Yield, ?Await] ;
|
||||||
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
|
flags: [noStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
if (false) let
|
||||||
|
[a] = 0;
|
|
@ -0,0 +1,16 @@
|
||||||
|
// Copyright (C) 2017 André Bargull. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-if-statement
|
||||||
|
description: >
|
||||||
|
ExpressionStatement doesn't have a lookahead restriction for `let {`.
|
||||||
|
info: |
|
||||||
|
ExpressionStatement[Yield, Await] :
|
||||||
|
[lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }]
|
||||||
|
Expression[+In, ?Yield, ?Await] ;
|
||||||
|
flags: [noStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
if (false) let // ASI
|
||||||
|
{}
|
|
@ -0,0 +1,16 @@
|
||||||
|
// Copyright (C) 2017 André Bargull. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-if-statement
|
||||||
|
description: >
|
||||||
|
ExpressionStatement doesn't have a lookahead restriction for `let <binding-identifier>`.
|
||||||
|
info: |
|
||||||
|
ExpressionStatement[Yield, Await] :
|
||||||
|
[lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }]
|
||||||
|
Expression[+In, ?Yield, ?Await] ;
|
||||||
|
flags: [noStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
if (false) let // ASI
|
||||||
|
x = 1;
|
|
@ -0,0 +1,22 @@
|
||||||
|
// Copyright (C) 2017 André Bargull. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-labelled-statements
|
||||||
|
description: >
|
||||||
|
ExpressionStatement has a lookahead restriction for `let [`.
|
||||||
|
info: |
|
||||||
|
ExpressionStatement[Yield, Await] :
|
||||||
|
[lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }]
|
||||||
|
Expression[+In, ?Yield, ?Await] ;
|
||||||
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
|
flags: [noStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
// Wrapped in an if-statement to avoid reference errors at runtime.
|
||||||
|
if (false) {
|
||||||
|
L: let
|
||||||
|
[a] = 0;
|
||||||
|
}
|
|
@ -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-labelled-statements
|
||||||
|
description: >
|
||||||
|
ExpressionStatement doesn't have a lookahead restriction for `let {`.
|
||||||
|
info: |
|
||||||
|
ExpressionStatement[Yield, Await] :
|
||||||
|
[lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }]
|
||||||
|
Expression[+In, ?Yield, ?Await] ;
|
||||||
|
flags: [noStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
// Wrapped in an if-statement to avoid reference errors at runtime.
|
||||||
|
if (false) {
|
||||||
|
L: let // ASI
|
||||||
|
{}
|
||||||
|
}
|
|
@ -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-labelled-statements
|
||||||
|
description: >
|
||||||
|
ExpressionStatement doesn't have a lookahead restriction for `let <binding-identifier>`.
|
||||||
|
info: |
|
||||||
|
ExpressionStatement[Yield, Await] :
|
||||||
|
[lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }]
|
||||||
|
Expression[+In, ?Yield, ?Await] ;
|
||||||
|
flags: [noStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
// Wrapped in an if-statement to avoid reference errors at runtime.
|
||||||
|
if (false) {
|
||||||
|
L: let // ASI
|
||||||
|
x = 1;
|
||||||
|
}
|
|
@ -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-while-statement
|
||||||
|
description: >
|
||||||
|
ExpressionStatement has a lookahead restriction for `let [`.
|
||||||
|
info: |
|
||||||
|
ExpressionStatement[Yield, Await] :
|
||||||
|
[lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }]
|
||||||
|
Expression[+In, ?Yield, ?Await] ;
|
||||||
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
|
flags: [noStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
while (false) let
|
||||||
|
[a] = 0;
|
|
@ -0,0 +1,16 @@
|
||||||
|
// Copyright (C) 2017 André Bargull. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-while-statement
|
||||||
|
description: >
|
||||||
|
ExpressionStatement doesn't have a lookahead restriction for `let {`.
|
||||||
|
info: |
|
||||||
|
ExpressionStatement[Yield, Await] :
|
||||||
|
[lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }]
|
||||||
|
Expression[+In, ?Yield, ?Await] ;
|
||||||
|
flags: [noStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
while (false) let // ASI
|
||||||
|
{}
|
|
@ -0,0 +1,16 @@
|
||||||
|
// Copyright (C) 2017 André Bargull. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-while-statement
|
||||||
|
description: >
|
||||||
|
ExpressionStatement doesn't have a lookahead restriction for `let <binding-identifier>`.
|
||||||
|
info: |
|
||||||
|
ExpressionStatement[Yield, Await] :
|
||||||
|
[lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }]
|
||||||
|
Expression[+In, ?Yield, ?Await] ;
|
||||||
|
flags: [noStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
while (false) let // ASI
|
||||||
|
x = 1;
|
|
@ -0,0 +1,22 @@
|
||||||
|
// Copyright (C) 2017 André Bargull. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-with-statement
|
||||||
|
description: >
|
||||||
|
ExpressionStatement has a lookahead restriction for `let [`.
|
||||||
|
info: |
|
||||||
|
ExpressionStatement[Yield, Await] :
|
||||||
|
[lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }]
|
||||||
|
Expression[+In, ?Yield, ?Await] ;
|
||||||
|
negative:
|
||||||
|
phase: early
|
||||||
|
type: SyntaxError
|
||||||
|
flags: [noStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
// Wrapped in an if-statement to avoid reference errors at runtime.
|
||||||
|
if (false) {
|
||||||
|
with ({}) let
|
||||||
|
[a] = 0;
|
||||||
|
}
|
|
@ -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-with-statement
|
||||||
|
description: >
|
||||||
|
ExpressionStatement doesn't have a lookahead restriction for `let {`.
|
||||||
|
info: |
|
||||||
|
ExpressionStatement[Yield, Await] :
|
||||||
|
[lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }]
|
||||||
|
Expression[+In, ?Yield, ?Await] ;
|
||||||
|
flags: [noStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
// Wrapped in an if-statement to avoid reference errors at runtime.
|
||||||
|
if (false) {
|
||||||
|
with ({}) let // ASI
|
||||||
|
{}
|
||||||
|
}
|
|
@ -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-with-statement
|
||||||
|
description: >
|
||||||
|
ExpressionStatement doesn't have a lookahead restriction for `let <binding-identifier>`.
|
||||||
|
info: |
|
||||||
|
ExpressionStatement[Yield, Await] :
|
||||||
|
[lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }]
|
||||||
|
Expression[+In, ?Yield, ?Await] ;
|
||||||
|
flags: [noStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
// Wrapped in an if-statement to avoid reference errors at runtime.
|
||||||
|
if (false) {
|
||||||
|
with ({}) let // ASI
|
||||||
|
x = 1;
|
||||||
|
}
|
Loading…
Reference in New Issue