[parser] Skipping inner funcs: add some more test cases which already pass.

BUG=v8:5516
R=vogelheim@chromium.org

Review-Url: https://codereview.chromium.org/2661173003
Cr-Commit-Position: refs/heads/master@{#42825}
This commit is contained in:
marja 2017-01-31 13:41:40 -08:00 committed by Commit bot
parent c03783f5f0
commit 639bf4aa9c

View File

@ -9229,6 +9229,13 @@ TEST(PreParserScopeAnalysis) {
{"", "var var1; var var1; function f() { var1; }"},
{"", "var var1; var var1; function f() { var1 = 5; }"},
{"", "var var1; if (true) { var var1; }"},
{"", "var var1; if (true) { let var1; }"},
{"", "let var1; if (true) { let var1; }"},
{"", "var var1; if (true) { const var1 = 0; }"},
{"", "const var1 = 0; if (true) { const var1 = 0; }"},
{"", "arguments;"},
{"", "arguments = 5;"},
{"", "function f() { arguments; }"},
@ -9283,6 +9290,27 @@ TEST(PreParserScopeAnalysis) {
{"",
"const {var1: var2, var3: {var4: var5}} = {var1: 1, var3: {var4: 2}};"},
{"", "const {var1: var2, var3: [var4, var5]} = {var1: 1, var3: [2, 3]};"},
{"", "inner;"},
{"", "function f1() { f1; }"},
{"", "function f1() { inner; }"},
{"", "function f1() { function f2() { f1; } }"},
{"", "function arguments() {}"},
{"", "function f1() {} function f1() {}"},
{"", "var f1; function f1() {}"},
{"", "inner = 3;"},
{"", "function f1() { f1 = 3; }"},
{"", "function f1() { f1; } f1 = 3;"},
{"", "function arguments() {} arguments = 8"},
{"", "function f1() {} f1 = 3; function f1() {}"},
{"", "var var1; eval('');"},
{"", "var var1; function f1() { eval(''); }"},
{"", "let var1; eval('');"},
{"", "let var1; function f1() { eval(''); }"},
{"", "const var1 = 10; eval('');"},
{"", "const var1 = 10; function f1() { eval(''); }"},
};
for (unsigned i = 0; i < arraysize(inners); ++i) {