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

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

Issue 2569983003: PreParsing inner funcs: Remove nonsense code from PreParser. (Closed)
Patch Set: more tests Created 4 years 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.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 f6fc10f1ff2ea0fcccf9eaf94c1fe8feb8587829..d6e05d97cc7c367cea33d0743dd09047abfc110f 100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -8467,6 +8467,12 @@ TEST(NoPessimisticContextAllocation) {
{"function inner() { var {my_var : a} = {my_var}; }", true},
{"function inner() { let {my_var : a} = {my_var}; }", true},
{"function inner() { const {my_var : a} = {my_var}; }", true},
+ {"function inner(a = my_var) { }", true},
+ {"function inner() { function inner2(a = my_var) { } }", true},
+ {"function inner({a} = {a: my_var}) { }", true},
+ {"function inner() { function inner2({a} = {a: my_var}) { } }", true},
+ {"function inner([a] = [my_var]) { }", true},
+ {"function inner() { function inner2([a] = [my_var]) { } }", true},
// No pessimistic context allocation:
{"function inner() { var my_var; my_var; }", false},
{"function inner() { var my_var; }", false},
@@ -8485,35 +8491,66 @@ TEST(NoPessimisticContextAllocation) {
{"function inner() { const {my_var} = {my_var: 3}; my_var; }", false},
{"function inner(my_var) { my_var; }", false},
{"function inner(my_var) { }", false},
+ {"function inner(my_var = 5) { my_var; }", false},
+ {"function inner(my_var = 5) { }", false},
{"function inner(...my_var) { my_var; }", false},
{"function inner(...my_var) { }", false},
{"function inner([a, my_var, b]) { my_var; }", false},
{"function inner([a, my_var, b]) { }", false},
+ {"function inner([a, my_var, b] = [1, 2, 3]) { my_var; }", false},
+ {"function inner([a, my_var, b] = [1, 2, 3]) { }", false},
{"function inner({x: my_var}) { my_var; }", false},
{"function inner({x: my_var}) { }", false},
+ {"function inner({x: my_var} = {x: 0}) { my_var; }", false},
+ {"function inner({x: my_var} = {x: 0}) { }", false},
{"function inner({my_var}) { my_var; }", false},
{"function inner({my_var}) { }", false},
+ {"function inner({my_var} = {my_var: 0}) { my_var; }", false},
+ {"function inner({my_var} = {my_var: 0}) { }", false},
{"function inner() { function inner2(my_var) { my_var; } }", false},
{"function inner() { function inner2(my_var) { } }", false},
+ {"function inner() { function inner2(my_var = 5) { my_var; } }", false},
+ {"function inner() { function inner2(my_var = 5) { } }", false},
{"function inner() { function inner2(...my_var) { my_var; } }", false},
{"function inner() { function inner2(...my_var) { } }", false},
{"function inner() { function inner2([a, my_var, b]) { my_var; } }",
false},
{"function inner() { function inner2([a, my_var, b]) { } }", false},
+ {"function inner() { function inner2([a, my_var, b] = [1, 2, 3]) { "
+ "my_var; } }",
+ false},
+ {"function inner() { function inner2([a, my_var, b] = [1, 2, 3]) { } }",
+ false},
{"function inner() { function inner2({x: my_var}) { my_var; } }", false},
{"function inner() { function inner2({x: my_var}) { } }", false},
+ {"function inner() { function inner2({x: my_var} = {x: 0}) { my_var; } }",
+ false},
+ {"function inner() { function inner2({x: my_var} = {x: 0}) { } }", false},
{"function inner() { function inner2({my_var}) { my_var; } }", false},
{"function inner() { function inner2({my_var}) { } }", false},
+ {"function inner() { function inner2({my_var} = {my_var: 8}) { my_var; } "
+ "}",
+ false},
+ {"function inner() { function inner2({my_var} = {my_var: 8}) { } }",
+ false},
{"my_var => my_var; ", false},
{"my_var => { }", false},
+ {"(my_var = 5) => my_var; ", false},
+ {"(my_var = 5) => { }", false},
{"(...my_var) => my_var;", false},
{"(...my_var) => { }", false},
{"([a, my_var, b]) => my_var;", false},
{"([a, my_var, b]) => { }", false},
+ {"([a, my_var, b] = [1, 2, 3]) => my_var;", false},
+ {"([a, my_var, b] = [1, 2, 3]) => { }", false},
{"({x: my_var}) => my_var;", false},
{"({x: my_var}) => { }", false},
+ {"({x: my_var} = {x: 0}) => my_var;", false},
+ {"({x: my_var} = {x: 0}) => { }", false},
{"({my_var}) => my_var;", false},
{"({my_var}) => { }", false},
+ {"({my_var} = {my_var: 5}) => my_var;", false},
+ {"({my_var} = {my_var: 5}) => { }", false},
{"function inner() { try { } catch (my_var) { } }", false},
{"function inner() { class my_var {}; }", false},
// In the following cases we still context allocate pessimistically:
@@ -8525,16 +8562,24 @@ TEST(NoPessimisticContextAllocation) {
{"function inner() { for (my_var of {}) { } }", true},
{"function inner() { for (my_var in []) { my_var; } }", true},
{"function inner() { for (my_var in []) { } }", true},
- {"function inner() { my_var => my_var; }", true},
+ {"function inner() { my_var => my_var; }", true},
{"function inner() { my_var => { }}", true},
- {"function inner() { (...my_var) => my_var;}", true},
+ {"function inner() { (my_var = 5) => my_var; }", true},
+ {"function inner() { (my_var = 5) => { }}", true},
+ {"function inner() { (...my_var) => my_var;}", true},
{"function inner() { (...my_var) => { }}", true},
{"function inner() { ([a, my_var, b]) => my_var;}", true},
{"function inner() { ([a, my_var, b]) => { }}", true},
+ {"function inner() { ([a, my_var, b] = [1, 2, 3]) => my_var;}", true},
+ {"function inner() { ([a, my_var, b] = [1, 2, 3]) => { }}", true},
{"function inner() { ({x: my_var}) => my_var;}", true},
{"function inner() { ({x: my_var}) => { }}", true},
+ {"function inner() { ({x: my_var} = {x: 0}) => my_var;}", true},
+ {"function inner() { ({x: my_var} = {x: 0}) => { }}", true},
{"function inner() { ({my_var}) => my_var;}", true},
{"function inner() { ({my_var}) => { }}", true},
+ {"function inner() { ({my_var} = {my_var: 5}) => my_var;}", true},
+ {"function inner() { ({my_var} = {my_var: 5}) => { }}", true},
{"function inner() { class my_var {}; my_var }", true},
};
« no previous file with comments | « src/parsing/preparser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698