mirror of
https://github.com/tc39/test262.git
synced 2025-07-25 15:04:43 +02:00
Add lookahead restriction tests for "let [" in expression statement contexts
This commit is contained in:
parent
75d153d280
commit
7a86baee7d
20
test/language/statements/do-while/let-array-with-newline.js
Normal file
20
test/language/statements/do-while/let-array-with-newline.js
Normal 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-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;
|
||||
}
|
19
test/language/statements/for-in/let-array-with-newline.js
Normal file
19
test/language/statements/for-in/let-array-with-newline.js
Normal 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-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;
|
16
test/language/statements/for-in/let-block-with-newline.js
Normal file
16
test/language/statements/for-in/let-block-with-newline.js
Normal file
@ -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;
|
19
test/language/statements/for-of/let-array-with-newline.js
Normal file
19
test/language/statements/for-of/let-array-with-newline.js
Normal 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-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;
|
16
test/language/statements/for-of/let-block-with-newline.js
Normal file
16
test/language/statements/for-of/let-block-with-newline.js
Normal file
@ -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;
|
19
test/language/statements/for/let-array-with-newline.js
Normal file
19
test/language/statements/for/let-array-with-newline.js
Normal 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-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;
|
16
test/language/statements/for/let-block-with-newline.js
Normal file
16
test/language/statements/for/let-block-with-newline.js
Normal file
@ -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
|
||||
{}
|
16
test/language/statements/for/let-identifier-with-newline.js
Normal file
16
test/language/statements/for/let-identifier-with-newline.js
Normal file
@ -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;
|
19
test/language/statements/if/let-array-with-newline.js
Normal file
19
test/language/statements/if/let-array-with-newline.js
Normal 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-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;
|
16
test/language/statements/if/let-block-with-newline.js
Normal file
16
test/language/statements/if/let-block-with-newline.js
Normal file
@ -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
|
||||
{}
|
16
test/language/statements/if/let-identifier-with-newline.js
Normal file
16
test/language/statements/if/let-identifier-with-newline.js
Normal file
@ -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;
|
22
test/language/statements/labeled/let-array-with-newline.js
Normal file
22
test/language/statements/labeled/let-array-with-newline.js
Normal file
@ -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;
|
||||
}
|
19
test/language/statements/labeled/let-block-with-newline.js
Normal file
19
test/language/statements/labeled/let-block-with-newline.js
Normal 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-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;
|
||||
}
|
19
test/language/statements/while/let-array-with-newline.js
Normal file
19
test/language/statements/while/let-array-with-newline.js
Normal 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-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;
|
16
test/language/statements/while/let-block-with-newline.js
Normal file
16
test/language/statements/while/let-block-with-newline.js
Normal file
@ -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;
|
22
test/language/statements/with/let-array-with-newline.js
Normal file
22
test/language/statements/with/let-array-with-newline.js
Normal file
@ -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;
|
||||
}
|
19
test/language/statements/with/let-block-with-newline.js
Normal file
19
test/language/statements/with/let-block-with-newline.js
Normal 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-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
|
||||
{}
|
||||
}
|
19
test/language/statements/with/let-identifier-with-newline.js
Normal file
19
test/language/statements/with/let-identifier-with-newline.js
Normal 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-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…
x
Reference in New Issue
Block a user