Index: test/mjsunit/es6/block-let-semantics.js |
diff --git a/test/mjsunit/es6/block-let-semantics.js b/test/mjsunit/es6/block-let-semantics.js |
index 5d4304169cfca386f0757d222480ec3f24d17d14..59eec1ceea354cf3e4aaced38ea77bda8b36bb15 100644 |
--- a/test/mjsunit/es6/block-let-semantics.js |
+++ b/test/mjsunit/es6/block-let-semantics.js |
@@ -70,6 +70,7 @@ TestAll('x += 1; let x;'); |
TestAll('++x; let x;'); |
TestAll('x++; let x;'); |
TestAll('let y = x; const x = 1;'); |
+TestAll('let y = x; class x {}'); |
TestAll('f(); let x; function f() { return x + 1; }'); |
TestAll('f(); let x; function f() { x = 1; }'); |
@@ -77,6 +78,7 @@ TestAll('f(); let x; function f() { x += 1; }'); |
TestAll('f(); let x; function f() { ++x; }'); |
TestAll('f(); let x; function f() { x++; }'); |
TestAll('f(); const x = 1; function f() { return x; }'); |
+TestAll('f(); class x { }; function f() { return x; }'); |
TestAll('f()(); let x; function f() { return function() { return x + 1; } }'); |
TestAll('f()(); let x; function f() { return function() { x = 1; } }'); |
@@ -84,22 +86,23 @@ TestAll('f()(); let x; function f() { return function() { x += 1; } }'); |
TestAll('f()(); let x; function f() { return function() { ++x; } }'); |
TestAll('f()(); let x; function f() { return function() { x++; } }'); |
TestAll('f()(); const x = 1; function f() { return function() { return x; } }'); |
+TestAll('f()(); class x { }; function f() { return function() { return x; } }'); |
-for (var kw of ['let', 'const']) { |
+for (var kw of ['let x = 2', 'const x = 2', 'class x { }']) { |
// Use before initialization with a dynamic lookup. |
- TestAll(`eval("x"); ${kw} x = 2;`); |
- TestAll(`eval("x + 1;"); ${kw} x = 2;`); |
- TestAll(`eval("x = 1;"); ${kw} x = 2;`); |
- TestAll(`eval("x += 1;"); ${kw} x = 2;`); |
- TestAll(`eval("++x;"); ${kw} x = 2;`); |
- TestAll(`eval("x++;"); ${kw} x = 2;`); |
+ TestAll(`eval("x"); ${kw};`); |
+ TestAll(`eval("x + 1;"); ${kw};`); |
+ TestAll(`eval("x = 1;"); ${kw};`); |
+ TestAll(`eval("x += 1;"); ${kw};`); |
+ TestAll(`eval("++x;"); ${kw};`); |
+ TestAll(`eval("x++;"); ${kw};`); |
// Use before initialization with check for eval-shadowed bindings. |
- TestAll(`function f() { eval("var y = 2;"); x + 1; }; f(); ${kw} x = 2;`); |
- TestAll(`function f() { eval("var y = 2;"); x = 1; }; f(); ${kw} x = 2;`); |
- TestAll(`function f() { eval("var y = 2;"); x += 1; }; f(); ${kw} x = 2;`); |
- TestAll(`function f() { eval("var y = 2;"); ++x; }; f(); ${kw} x = 2;`); |
- TestAll(`function f() { eval("var y = 2;"); x++; }; f(); ${kw} x = 2;`); |
+ TestAll(`function f() { eval("var y = 2;"); x + 1; }; f(); ${kw};`); |
+ TestAll(`function f() { eval("var y = 2;"); x = 1; }; f(); ${kw};`); |
+ TestAll(`function f() { eval("var y = 2;"); x += 1; }; f(); ${kw};`); |
+ TestAll(`function f() { eval("var y = 2;"); ++x; }; f(); ${kw};`); |
+ TestAll(`function f() { eval("var y = 2;"); x++; }; f(); ${kw};`); |
} |
// Test that variables introduced by function declarations are created and |