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

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

Issue 2610823003: PreParsing inner funcs: declare arrow function parameters. (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.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 09325deaf72e92d9efdd4d1d546a0dcbcf4be032..9b2d35bb9fba33b6ea1f399661baec8b7088610d 100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -8564,10 +8564,13 @@ TEST(NoPessimisticContextAllocation) {
{"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 = my_var) => { } }", true},
{"function inner({a} = {a: my_var}) { }", true},
{"function inner() { function inner2({a} = {a: my_var}) { } }", true},
+ {"function inner() { ({a} = {a: my_var}) => { } }", true},
{"function inner([a] = [my_var]) { }", true},
{"function inner() { function inner2([a] = [my_var]) { } }", true},
+ {"function inner() { ([a] = [my_var]) => { } }", true},
// No pessimistic context allocation:
{"function inner() { var my_var; my_var; }", false},
{"function inner() { var my_var; }", false},
@@ -8648,6 +8651,24 @@ TEST(NoPessimisticContextAllocation) {
{"({my_var} = {my_var: 5}) => { }", false},
{"function inner() { try { } catch (my_var) { } }", false},
{"function inner() { class my_var {}; }", false},
+ {"function inner() { my_var => my_var; }", false},
adamk 2017/01/04 19:28:47 How does this one work?
+ {"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},
adamk 2017/01/04 19:28:47 And this one?
+ {"function inner() { ({my_var}) => { }}", false},
+ {"function inner() { ({my_var} = {my_var: 5}) => my_var;}", false},
+ {"function inner() { ({my_var} = {my_var: 5}) => { }}", 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; }",
@@ -8657,24 +8678,6 @@ 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 => { }}", 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