Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Unified Diff: test/mjsunit/harmony/block-let-semantics-sloppy.js

Issue 1286923002: Add class to existing lexical scoping tests (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix test bug Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/harmony/block-let-declaration-sloppy.js ('k') | test/mjsunit/harmony/block-scoping-sloppy.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « test/mjsunit/harmony/block-let-declaration-sloppy.js ('k') | test/mjsunit/harmony/block-scoping-sloppy.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698