From 7a86baee7d53eee83ac283aa7693f813d3818d01 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Bargull?= <andre.bargull@gmail.com>
Date: Tue, 2 May 2017 12:09:28 -0700
Subject: [PATCH] Add lookahead restriction tests for "let [" in expression
 statement contexts

---
 .../do-while/let-array-with-newline.js        | 20 +++++++++++++++++
 .../for-await-of/let-array-with-newline.js    | 22 +++++++++++++++++++
 .../for-await-of/let-block-with-newline.js    | 19 ++++++++++++++++
 .../let-identifier-with-newline.js            | 19 ++++++++++++++++
 .../for-in/let-array-with-newline.js          | 19 ++++++++++++++++
 .../for-in/let-block-with-newline.js          | 16 ++++++++++++++
 .../for-in/let-identifier-with-newline.js     | 16 ++++++++++++++
 .../for-of/let-array-with-newline.js          | 19 ++++++++++++++++
 .../for-of/let-block-with-newline.js          | 16 ++++++++++++++
 .../for-of/let-identifier-with-newline.js     | 16 ++++++++++++++
 .../statements/for/let-array-with-newline.js  | 19 ++++++++++++++++
 .../statements/for/let-block-with-newline.js  | 16 ++++++++++++++
 .../for/let-identifier-with-newline.js        | 16 ++++++++++++++
 .../statements/if/let-array-with-newline.js   | 19 ++++++++++++++++
 .../statements/if/let-block-with-newline.js   | 16 ++++++++++++++
 .../if/let-identifier-with-newline.js         | 16 ++++++++++++++
 .../labeled/let-array-with-newline.js         | 22 +++++++++++++++++++
 .../labeled/let-block-with-newline.js         | 19 ++++++++++++++++
 .../labeled/let-identifier-with-newline.js    | 19 ++++++++++++++++
 .../while/let-array-with-newline.js           | 19 ++++++++++++++++
 .../while/let-block-with-newline.js           | 16 ++++++++++++++
 .../while/let-identifier-with-newline.js      | 16 ++++++++++++++
 .../statements/with/let-array-with-newline.js | 22 +++++++++++++++++++
 .../statements/with/let-block-with-newline.js | 19 ++++++++++++++++
 .../with/let-identifier-with-newline.js       | 19 ++++++++++++++++
 25 files changed, 455 insertions(+)
 create mode 100644 test/language/statements/do-while/let-array-with-newline.js
 create mode 100644 test/language/statements/for-await-of/let-array-with-newline.js
 create mode 100644 test/language/statements/for-await-of/let-block-with-newline.js
 create mode 100644 test/language/statements/for-await-of/let-identifier-with-newline.js
 create mode 100644 test/language/statements/for-in/let-array-with-newline.js
 create mode 100644 test/language/statements/for-in/let-block-with-newline.js
 create mode 100644 test/language/statements/for-in/let-identifier-with-newline.js
 create mode 100644 test/language/statements/for-of/let-array-with-newline.js
 create mode 100644 test/language/statements/for-of/let-block-with-newline.js
 create mode 100644 test/language/statements/for-of/let-identifier-with-newline.js
 create mode 100644 test/language/statements/for/let-array-with-newline.js
 create mode 100644 test/language/statements/for/let-block-with-newline.js
 create mode 100644 test/language/statements/for/let-identifier-with-newline.js
 create mode 100644 test/language/statements/if/let-array-with-newline.js
 create mode 100644 test/language/statements/if/let-block-with-newline.js
 create mode 100644 test/language/statements/if/let-identifier-with-newline.js
 create mode 100644 test/language/statements/labeled/let-array-with-newline.js
 create mode 100644 test/language/statements/labeled/let-block-with-newline.js
 create mode 100644 test/language/statements/labeled/let-identifier-with-newline.js
 create mode 100644 test/language/statements/while/let-array-with-newline.js
 create mode 100644 test/language/statements/while/let-block-with-newline.js
 create mode 100644 test/language/statements/while/let-identifier-with-newline.js
 create mode 100644 test/language/statements/with/let-array-with-newline.js
 create mode 100644 test/language/statements/with/let-block-with-newline.js
 create mode 100644 test/language/statements/with/let-identifier-with-newline.js

diff --git a/test/language/statements/do-while/let-array-with-newline.js b/test/language/statements/do-while/let-array-with-newline.js
new file mode 100644
index 0000000000..faf318f0e1
--- /dev/null
+++ b/test/language/statements/do-while/let-array-with-newline.js
@@ -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);
diff --git a/test/language/statements/for-await-of/let-array-with-newline.js b/test/language/statements/for-await-of/let-array-with-newline.js
new file mode 100644
index 0000000000..08b68c1b2d
--- /dev/null
+++ b/test/language/statements/for-await-of/let-array-with-newline.js
@@ -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;
+}
diff --git a/test/language/statements/for-await-of/let-block-with-newline.js b/test/language/statements/for-await-of/let-block-with-newline.js
new file mode 100644
index 0000000000..ba5a9ee3db
--- /dev/null
+++ b/test/language/statements/for-await-of/let-block-with-newline.js
@@ -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
+  {}
+}
diff --git a/test/language/statements/for-await-of/let-identifier-with-newline.js b/test/language/statements/for-await-of/let-identifier-with-newline.js
new file mode 100644
index 0000000000..87a3cb38d0
--- /dev/null
+++ b/test/language/statements/for-await-of/let-identifier-with-newline.js
@@ -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;
+}
diff --git a/test/language/statements/for-in/let-array-with-newline.js b/test/language/statements/for-in/let-array-with-newline.js
new file mode 100644
index 0000000000..7acf629235
--- /dev/null
+++ b/test/language/statements/for-in/let-array-with-newline.js
@@ -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;
diff --git a/test/language/statements/for-in/let-block-with-newline.js b/test/language/statements/for-in/let-block-with-newline.js
new file mode 100644
index 0000000000..05fe78c593
--- /dev/null
+++ b/test/language/statements/for-in/let-block-with-newline.js
@@ -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
+{}
diff --git a/test/language/statements/for-in/let-identifier-with-newline.js b/test/language/statements/for-in/let-identifier-with-newline.js
new file mode 100644
index 0000000000..b3f148230c
--- /dev/null
+++ b/test/language/statements/for-in/let-identifier-with-newline.js
@@ -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;
diff --git a/test/language/statements/for-of/let-array-with-newline.js b/test/language/statements/for-of/let-array-with-newline.js
new file mode 100644
index 0000000000..4d19ec3fa3
--- /dev/null
+++ b/test/language/statements/for-of/let-array-with-newline.js
@@ -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;
diff --git a/test/language/statements/for-of/let-block-with-newline.js b/test/language/statements/for-of/let-block-with-newline.js
new file mode 100644
index 0000000000..1f19ec14bf
--- /dev/null
+++ b/test/language/statements/for-of/let-block-with-newline.js
@@ -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
+{}
diff --git a/test/language/statements/for-of/let-identifier-with-newline.js b/test/language/statements/for-of/let-identifier-with-newline.js
new file mode 100644
index 0000000000..63e088c1c3
--- /dev/null
+++ b/test/language/statements/for-of/let-identifier-with-newline.js
@@ -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;
diff --git a/test/language/statements/for/let-array-with-newline.js b/test/language/statements/for/let-array-with-newline.js
new file mode 100644
index 0000000000..da29097908
--- /dev/null
+++ b/test/language/statements/for/let-array-with-newline.js
@@ -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;
diff --git a/test/language/statements/for/let-block-with-newline.js b/test/language/statements/for/let-block-with-newline.js
new file mode 100644
index 0000000000..681f0b34a6
--- /dev/null
+++ b/test/language/statements/for/let-block-with-newline.js
@@ -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
+{}
diff --git a/test/language/statements/for/let-identifier-with-newline.js b/test/language/statements/for/let-identifier-with-newline.js
new file mode 100644
index 0000000000..ba18fac90d
--- /dev/null
+++ b/test/language/statements/for/let-identifier-with-newline.js
@@ -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;
diff --git a/test/language/statements/if/let-array-with-newline.js b/test/language/statements/if/let-array-with-newline.js
new file mode 100644
index 0000000000..e0d970d4d0
--- /dev/null
+++ b/test/language/statements/if/let-array-with-newline.js
@@ -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;
diff --git a/test/language/statements/if/let-block-with-newline.js b/test/language/statements/if/let-block-with-newline.js
new file mode 100644
index 0000000000..aac5dbb3d3
--- /dev/null
+++ b/test/language/statements/if/let-block-with-newline.js
@@ -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
+{}
diff --git a/test/language/statements/if/let-identifier-with-newline.js b/test/language/statements/if/let-identifier-with-newline.js
new file mode 100644
index 0000000000..e4a646a5a0
--- /dev/null
+++ b/test/language/statements/if/let-identifier-with-newline.js
@@ -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;
diff --git a/test/language/statements/labeled/let-array-with-newline.js b/test/language/statements/labeled/let-array-with-newline.js
new file mode 100644
index 0000000000..c8d5ffaa97
--- /dev/null
+++ b/test/language/statements/labeled/let-array-with-newline.js
@@ -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;
+}
diff --git a/test/language/statements/labeled/let-block-with-newline.js b/test/language/statements/labeled/let-block-with-newline.js
new file mode 100644
index 0000000000..8a8d44c065
--- /dev/null
+++ b/test/language/statements/labeled/let-block-with-newline.js
@@ -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
+    {}
+}
diff --git a/test/language/statements/labeled/let-identifier-with-newline.js b/test/language/statements/labeled/let-identifier-with-newline.js
new file mode 100644
index 0000000000..b8a184d7b5
--- /dev/null
+++ b/test/language/statements/labeled/let-identifier-with-newline.js
@@ -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;
+}
diff --git a/test/language/statements/while/let-array-with-newline.js b/test/language/statements/while/let-array-with-newline.js
new file mode 100644
index 0000000000..55b13d6d09
--- /dev/null
+++ b/test/language/statements/while/let-array-with-newline.js
@@ -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;
diff --git a/test/language/statements/while/let-block-with-newline.js b/test/language/statements/while/let-block-with-newline.js
new file mode 100644
index 0000000000..fa2a2ae6d7
--- /dev/null
+++ b/test/language/statements/while/let-block-with-newline.js
@@ -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
+{}
diff --git a/test/language/statements/while/let-identifier-with-newline.js b/test/language/statements/while/let-identifier-with-newline.js
new file mode 100644
index 0000000000..634960798d
--- /dev/null
+++ b/test/language/statements/while/let-identifier-with-newline.js
@@ -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;
diff --git a/test/language/statements/with/let-array-with-newline.js b/test/language/statements/with/let-array-with-newline.js
new file mode 100644
index 0000000000..d1e53378eb
--- /dev/null
+++ b/test/language/statements/with/let-array-with-newline.js
@@ -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;
+}
diff --git a/test/language/statements/with/let-block-with-newline.js b/test/language/statements/with/let-block-with-newline.js
new file mode 100644
index 0000000000..90d0141a0e
--- /dev/null
+++ b/test/language/statements/with/let-block-with-newline.js
@@ -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
+    {}
+}
diff --git a/test/language/statements/with/let-identifier-with-newline.js b/test/language/statements/with/let-identifier-with-newline.js
new file mode 100644
index 0000000000..f938fc2c8c
--- /dev/null
+++ b/test/language/statements/with/let-identifier-with-newline.js
@@ -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;
+}
-- 
GitLab