Index: test/mjsunit/harmony/block-let-semantics-sloppy.js |
diff --git a/test/mjsunit/harmony/block-let-semantics-sloppy.js b/test/mjsunit/harmony/block-let-semantics-sloppy.js |
index 33fdc45251db68fcd49dfec59723ba8b1d640ada..d8be278c29a1154b3d2bc312861a7ff9a393fc6f 100644 |
--- a/test/mjsunit/harmony/block-let-semantics-sloppy.js |
+++ b/test/mjsunit/harmony/block-let-semantics-sloppy.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 |