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

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

Issue 2617923003: PreParsing inner funcs: make scope analysis more complete. (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
« src/parsing/preparser.h ('K') | « src/parsing/preparser.h ('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 805cc0a01873724d1ea6105833189447cc7d7d69..8432386f84bfc5c44163262945fc7127605be8de 100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -8713,62 +8713,76 @@ TEST(NoPessimisticContextAllocation) {
{"function inner() { ({y, x: my_var}) => { }}", false},
{"function inner() { ({y, x: my_var} = {y: 0, x: 0}) => my_var;}", false},
{"function inner() { ({y, x: my_var} = {y: 0, x: 0}) => { }}", false},
+ {"function inner() { try { } catch (my_var) { my_var; } }", false},
+ {"function inner() { try { } catch ([a, my_var, b]) { my_var; } }",
+ false},
+ {"function inner() { try { } catch ({x: my_var}) { my_var; } }", false},
+ {"function inner() { try { } catch ({y, x: my_var}) { my_var; } }",
+ false},
+ {"function inner() { try { } catch ({my_var}) { my_var; } }", false},
+ {"function inner() { for (let my_var in {}) { my_var; } }", false},
+ {"function inner() { for (let my_var in {}) { } }", false},
+ {"function inner() { for (let my_var of []) { my_var; } }", false},
+ {"function inner() { for (let my_var of []) { } }", false},
+ {"function inner() { for (let [a, my_var, b] in {}) { my_var; } }",
+ false},
+ {"function inner() { for (let [a, my_var, b] of []) { my_var; } }",
+ false},
+ {"function inner() { for (let {x: my_var} in {}) { my_var; } }", false},
+ {"function inner() { for (let {x: my_var} of []) { my_var; } }", false},
+ {"function inner() { for (let {my_var} in {}) { my_var; } }", false},
+ {"function inner() { for (let {my_var} of []) { my_var; } }", false},
+ {"function inner() { for (let {y, x: my_var} in {}) { my_var; } }",
+ false},
+ {"function inner() { for (let {y, x: my_var} of []) { my_var; } }",
+ false},
+ {"function inner() { for (let {a, my_var} in {}) { my_var; } }", false},
+ {"function inner() { for (let {a, my_var} of []) { my_var; } }", false},
+ {"function inner() { for (var my_var in {}) { my_var; } }", false},
+ {"function inner() { for (var my_var in {}) { } }", false},
+ {"function inner() { for (var my_var of []) { my_var; } }", false},
+ {"function inner() { for (var my_var of []) { } }", false},
+ {"function inner() { for (var [a, my_var, b] in {}) { my_var; } }",
+ false},
+ {"function inner() { for (var [a, my_var, b] of []) { my_var; } }",
+ false},
+ {"function inner() { for (var {x: my_var} in {}) { my_var; } }", false},
+ {"function inner() { for (var {x: my_var} of []) { my_var; } }", false},
+ {"function inner() { for (var {my_var} in {}) { my_var; } }", false},
+ {"function inner() { for (var {my_var} of []) { my_var; } }", false},
+ {"function inner() { for (var {y, x: my_var} in {}) { my_var; } }",
+ false},
+ {"function inner() { for (var {y, x: my_var} of []) { my_var; } }",
+ false},
+ {"function inner() { for (var {a, my_var} in {}) { my_var; } }", false},
+ {"function inner() { for (var {a, my_var} of []) { my_var; } }", false},
+ {"function inner() { for (var my_var in {}) { } my_var; }", false},
+ {"function inner() { for (var my_var of []) { } my_var; }", false},
+ {"function inner() { for (var [a, my_var, b] in {}) { } my_var; }",
+ false},
+ {"function inner() { for (var [a, my_var, b] of []) { } my_var; }",
+ false},
+ {"function inner() { for (var {x: my_var} in {}) { } my_var; }", false},
+ {"function inner() { for (var {x: my_var} of []) { } my_var; }", false},
+ {"function inner() { for (var {my_var} in {}) { } my_var; }", false},
+ {"function inner() { for (var {my_var} of []) { } my_var; }", false},
+ {"function inner() { for (var {y, x: my_var} in {}) { } my_var; }",
+ false},
+ {"function inner() { for (var {y, x: my_var} of []) { } my_var; }",
+ false},
+ {"function inner() { for (var {a, my_var} in {}) { } my_var; }", false},
+ {"function inner() { for (var {a, my_var} of []) { } my_var; }", false},
+ {"function inner() { class my_var {}; my_var }", false},
// In the following cases we still context allocate pessimistically:
{"function inner() { function my_var() {} my_var; }", true},
{"function inner() { if (true) { function my_var() {} } my_var; }",
true},
- {"function inner() { try { } catch (my_var) { my_var; } }", true},
- {"function inner() { try { } catch ([a, my_var, b]) { my_var; } }", true},
- {"function inner() { try { } catch ({x: my_var}) { my_var; } }", true},
- {"function inner() { try { } catch ({y, x: my_var}) { my_var; } }", true},
- {"function inner() { try { } catch ({my_var}) { my_var; } }", true},
{"function inner() { for (let my_var = 0; my_var < 1; ++my_var) { my_var "
"} }",
true},
{"function inner() { for (let a = 0, my_var = 0; my_var < 1; ++my_var) { "
"my_var } }",
true},
- {"function inner() { for (let my_var in {}) { my_var; } }", true},
- {"function inner() { for (let my_var in {}) { } }", true},
- {"function inner() { for (let my_var of []) { my_var; } }", true},
- {"function inner() { for (let my_var of []) { } }", true},
- {"function inner() { for (let [a, my_var, b] in {}) { my_var; } }", true},
- {"function inner() { for (let [a, my_var, b] of []) { my_var; } }", true},
- {"function inner() { for (let {x: my_var} in {}) { my_var; } }", true},
- {"function inner() { for (let {x: my_var} of []) { my_var; } }", true},
- {"function inner() { for (let {my_var} in {}) { my_var; } }", true},
- {"function inner() { for (let {my_var} of []) { my_var; } }", true},
- {"function inner() { for (let {y, x: my_var} in {}) { my_var; } }", true},
- {"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 (var my_var in {}) { my_var; } }", true},
- {"function inner() { for (var my_var in {}) { } }", true},
- {"function inner() { for (var my_var of []) { my_var; } }", true},
- {"function inner() { for (var my_var of []) { } }", true},
- {"function inner() { for (var [a, my_var, b] in {}) { my_var; } }", true},
- {"function inner() { for (var [a, my_var, b] of []) { my_var; } }", true},
- {"function inner() { for (var {x: my_var} in {}) { my_var; } }", true},
- {"function inner() { for (var {x: my_var} of []) { my_var; } }", true},
- {"function inner() { for (var {my_var} in {}) { my_var; } }", true},
- {"function inner() { for (var {my_var} of []) { my_var; } }", true},
- {"function inner() { for (var {y, x: my_var} in {}) { my_var; } }", true},
- {"function inner() { for (var {y, x: my_var} of []) { my_var; } }", true},
- {"function inner() { for (var {a, my_var} in {}) { my_var; } }", true},
- {"function inner() { for (var {a, my_var} of []) { my_var; } }", true},
- {"function inner() { for (var my_var in {}) { } my_var; }", true},
- {"function inner() { for (var my_var of []) { } my_var; }", true},
- {"function inner() { for (var [a, my_var, b] in {}) { } my_var; }", true},
- {"function inner() { for (var [a, my_var, b] of []) { } my_var; }", true},
- {"function inner() { for (var {x: my_var} in {}) { } my_var; }", true},
- {"function inner() { for (var {x: my_var} of []) { } my_var; }", true},
- {"function inner() { for (var {my_var} in {}) { } my_var; }", true},
- {"function inner() { for (var {my_var} of []) { } my_var; }", true},
- {"function inner() { for (var {y, x: my_var} in {}) { } my_var; }", true},
- {"function inner() { for (var {y, x: my_var} of []) { } my_var; }", true},
- {"function inner() { for (var {a, my_var} in {}) { } my_var; }", true},
- {"function inner() { for (var {a, my_var} of []) { } my_var; }", true},
- {"function inner() { class my_var {}; my_var }", true},
};
for (unsigned i = 0; i < arraysize(inners); ++i) {
« src/parsing/preparser.h ('K') | « src/parsing/preparser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698