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

Unified Diff: test/mjsunit/es6/block-let-semantics.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/es6/block-let-declaration.js ('k') | test/mjsunit/es6/block-scoping.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « test/mjsunit/es6/block-let-declaration.js ('k') | test/mjsunit/es6/block-scoping.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698