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

Unified Diff: test/mjsunit/es6/tail-call.js

Issue 2343823002: [parser] Fix tail calls in for in/of loops (Closed)
Patch Set: Better rebase Created 4 years, 3 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 | « src/parsing/parser.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/es6/tail-call.js
diff --git a/test/mjsunit/es6/tail-call.js b/test/mjsunit/es6/tail-call.js
index 6ecf04f3d99414e61e19ebba6349f74c9d63d7a7..4df4836021ea8edbd5f25d716d9c86386887f8ee 100644
--- a/test/mjsunit/es6/tail-call.js
+++ b/test/mjsunit/es6/tail-call.js
@@ -295,7 +295,7 @@ function f_153(expected_call_stack, a) {
function test() {
var o = new A();
- %DebugPrint(o);
+ //%DebugPrint(o);
assertEquals(153, o.x);
}
@@ -387,18 +387,57 @@ function f_153(expected_call_stack, a) {
}
}
+ function g1let() {
+ for (let v in {a:0}) {
+ return f_153([f_153, g1let, test]);
+ }
+ }
+
+ function g1nodecl() {
+ var v;
+ for (v in {a:0}) {
+ return f_153([f_153, g1nodecl, test]);
+ }
+ }
+
function g2() {
for (var v of [1, 2, 3]) {
return f_153([f_153, g2, test]);
}
}
+ function g2let() {
+ for (let v of [1, 2, 3]) {
+ return f_153([f_153, g2let, test]);
+ }
+ }
+
+ function g2nodecl() {
+ var v;
+ for (v of [1, 2, 3]) {
+ return f_153([f_153, g2nodecl, test]);
+ }
+ }
+
function g3() {
for (var i = 0; i < 10; i++) {
return f_153([f_153, test]);
}
}
+ function g3let() {
+ for (let i = 0; i < 10; i++) {
+ return f_153([f_153, test]);
+ }
+ }
+
+ function g3nodecl() {
+ var i;
+ for (i = 0; i < 10; i++) {
+ return f_153([f_153, test]);
+ }
+ }
+
function g4() {
while (true) {
return f_153([f_153, test]);
@@ -413,8 +452,14 @@ function f_153(expected_call_stack, a) {
function test() {
assertEquals(153, g1());
+ assertEquals(153, g1let());
+ assertEquals(153, g1nodecl());
assertEquals(153, g2());
+ assertEquals(153, g2let());
+ assertEquals(153, g2nodecl());
assertEquals(153, g3());
+ assertEquals(153, g3let());
+ assertEquals(153, g3nodecl());
assertEquals(153, g4());
assertEquals(153, g5());
}
« no previous file with comments | « src/parsing/parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698