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

Unified Diff: test/cctest/test-parsing.cc

Issue 2623583004: PreParser scope analysis: simplify DeclareAndInitializeVariables. (Closed)
Patch Set: Created 3 years, 11 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/preparser.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-parsing.cc
diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc
index 66db258d0196682c0f52bcd952e1091d8360c8ae..ff5ac4d920a3b507a23a73cf90ccc1bc97926ea7 100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -8692,12 +8692,17 @@ TEST(NoPessimisticContextAllocation) {
{"function inner() { for (let {y, x: my_var} of []) { } my_var; }", true},
{"function inner() { for (let {a, my_var} in {}) { } my_var; }", true},
{"function inner() { for (let {a, my_var} of []) { } my_var; }", true},
+ {"function inner() { for (let my_var = 0; my_var < 1; ++my_var) { } "
+ "my_var }",
+ true},
// No pessimistic context allocation:
{"function inner() { var my_var; my_var; }", false},
{"function inner() { var my_var; }", false},
+ {"function inner() { var my_var = 0; }", false},
{"function inner() { if (true) { var my_var; } my_var; }", false},
{"function inner() { let my_var; my_var; }", false},
{"function inner() { let my_var; }", false},
+ {"function inner() { let my_var = 0; }", false},
{"function inner() { const my_var = 0; my_var; }", false},
{"function inner() { const my_var = 0; }", false},
{"function inner() { var [a, my_var] = [1, 2]; my_var; }", false},
@@ -8871,6 +8876,9 @@ TEST(NoPessimisticContextAllocation) {
{"function inner() { for (var my_var = 0; my_var < 1; ++my_var) { my_var "
"} }",
false},
+ {"function inner() { for (var my_var = 0; my_var < 1; ++my_var) { } "
+ "my_var }",
+ false},
{"function inner() { for (let a = 0, my_var = 0; my_var < 1; ++my_var) { "
"my_var } }",
false},
« no previous file with comments | « src/parsing/preparser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698