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

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

Issue 2614023004: Preparsing inner funcs: Update tests. (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 | « no previous file | 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 9b2d35bb9fba33b6ea1f399661baec8b7088610d..805cc0a01873724d1ea6105833189447cc7d7d69 100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -8556,6 +8556,7 @@ TEST(NoPessimisticContextAllocation) {
} inners[] = {
// Context allocating because we need to:
{"function inner() { my_var; }", true},
+ {"function inner() { if (true) { let my_var; } my_var; }", true},
{"function inner() { eval(\"foo\"); }", true},
{"function inner() { function inner2() { my_var; } }", true},
{"function inner() { function inner2() { eval(\"foo\"); } }", true},
@@ -8571,9 +8572,37 @@ TEST(NoPessimisticContextAllocation) {
{"function inner([a] = [my_var]) { }", true},
{"function inner() { function inner2([a] = [my_var]) { } }", true},
{"function inner() { ([a] = [my_var]) => { } }", true},
+ {"function inner() { try { } catch (my_var) { } my_var; }", true},
+ {"function inner() { for (my_var in {}) { my_var; } }", true},
+ {"function inner() { for (my_var in {}) { } }", true},
+ {"function inner() { for (my_var of []) { my_var; } }", true},
+ {"function inner() { for (my_var of []) { } }", true},
+ {"function inner() { for ([a, my_var, b] in {}) { my_var; } }", true},
+ {"function inner() { for ([a, my_var, b] of []) { my_var; } }", true},
+ {"function inner() { for ({x: my_var} in {}) { my_var; } }", true},
+ {"function inner() { for ({x: my_var} of []) { my_var; } }", true},
+ {"function inner() { for ({my_var} in {}) { my_var; } }", true},
+ {"function inner() { for ({my_var} of []) { my_var; } }", true},
+ {"function inner() { for ({y, x: my_var} in {}) { my_var; } }", true},
+ {"function inner() { for ({y, x: my_var} of []) { my_var; } }", true},
+ {"function inner() { for ({a, my_var} in {}) { my_var; } }", true},
+ {"function inner() { for ({a, 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 [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},
// No pessimistic context allocation:
{"function inner() { var my_var; my_var; }", false},
{"function inner() { var my_var; }", 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() { const my_var = 0; my_var; }", false},
@@ -8649,8 +8678,14 @@ TEST(NoPessimisticContextAllocation) {
{"({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},
+ {"({a, my_var}) => my_var;", false},
+ {"({a, my_var}) => { }", false},
+ {"({a, my_var} = {a: 0, my_var: 5}) => my_var;", false},
+ {"({a, my_var} = {a: 0, my_var: 5}) => { }", false},
+ {"({y, x: my_var}) => my_var;", false},
+ {"({y, x: my_var}) => { }", false},
+ {"({y, x: my_var} = {y: 0, x: 0}) => my_var;", false},
+ {"({y, x: my_var} = {y: 0, x: 0}) => { }", false},
{"function inner() { my_var => my_var; }", false},
{"function inner() { my_var => { }}", false},
{"function inner() { (my_var = 5) => my_var; }", false},
@@ -8669,15 +8704,70 @@ TEST(NoPessimisticContextAllocation) {
{"function inner() { ({my_var}) => { }}", false},
{"function inner() { ({my_var} = {my_var: 5}) => my_var;}", false},
{"function inner() { ({my_var} = {my_var: 5}) => { }}", false},
+ {"function inner() { ({a, my_var}) => my_var;}", false},
+ {"function inner() { ({a, my_var}) => { }}", false},
+ {"function inner() { ({a, my_var} = {a: 0, my_var: 5}) => my_var;}",
+ false},
+ {"function inner() { ({a, my_var} = {a: 0, my_var: 5}) => { }}", false},
+ {"function inner() { ({y, x: my_var}) => my_var;}", false},
+ {"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},
// 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() { for (my_var of {}) { my_var; } }", true},
- {"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() { 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},
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698