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

Side by Side Diff: test/cctest/test-parsing.cc

Issue 2661233002: [parser] Add more tests for preparser variable tracking. (Closed)
Patch Set: Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 8760 matching lines...) Expand 10 before | Expand all | Expand 10 after
8771 } inners[] = { 8771 } inners[] = {
8772 // Context allocating because we need to: 8772 // Context allocating because we need to:
8773 {"", "my_var;", true}, 8773 {"", "my_var;", true},
8774 {"", "if (true) { let my_var; } my_var;", true}, 8774 {"", "if (true) { let my_var; } my_var;", true},
8775 {"", "eval('foo');", true}, 8775 {"", "eval('foo');", true},
8776 {"", "function inner2() { my_var; }", true}, 8776 {"", "function inner2() { my_var; }", true},
8777 {"", "function inner2() { eval('foo'); }", true}, 8777 {"", "function inner2() { eval('foo'); }", true},
8778 {"", "var {my_var : a} = {my_var};", true}, 8778 {"", "var {my_var : a} = {my_var};", true},
8779 {"", "let {my_var : a} = {my_var};", true}, 8779 {"", "let {my_var : a} = {my_var};", true},
8780 {"", "const {my_var : a} = {my_var};", true}, 8780 {"", "const {my_var : a} = {my_var};", true},
8781 {"", "var [a, b = my_var] = [1, 2];", true},
8782 {"", "var [a, b = my_var] = [1, 2]; my_var;", true},
8783 {"", "let [a, b = my_var] = [1, 2];", true},
8784 {"", "let [a, b = my_var] = [1, 2]; my_var;", true},
8785 {"", "const [a, b = my_var] = [1, 2];", true},
8786 {"", "const [a, b = my_var] = [1, 2]; my_var;", true},
8787 {"", "var {a = my_var} = {}", true},
8788 {"", "var {a: b = my_var} = {}", true},
8789 {"", "let {a = my_var} = {}", true},
8790 {"", "let {a: b = my_var} = {}", true},
8791 {"", "const {a = my_var} = {}", true},
8792 {"", "const {a: b = my_var} = {}", true},
8781 {"a = my_var", "", true}, 8793 {"a = my_var", "", true},
8782 {"", "function inner2(a = my_var) { }", true}, 8794 {"", "function inner2(a = my_var) { }", true},
8783 {"", "(a = my_var) => { }", true}, 8795 {"", "(a = my_var) => { }", true},
8784 {"{a} = {a: my_var}", "", true}, 8796 {"{a} = {a: my_var}", "", true},
8785 {"", "function inner2({a} = {a: my_var}) { }", true}, 8797 {"", "function inner2({a} = {a: my_var}) { }", true},
8786 {"", "({a} = {a: my_var}) => { }", true}, 8798 {"", "({a} = {a: my_var}) => { }", true},
8787 {"[a] = [my_var]", "", true}, 8799 {"[a] = [my_var]", "", true},
8788 {"", "function inner2([a] = [my_var]) { }", true}, 8800 {"", "function inner2([a] = [my_var]) { }", true},
8789 {"", "([a] = [my_var]) => { }", true}, 8801 {"", "([a] = [my_var]) => { }", true},
8790 {"", "function inner2(a = eval('')) { }", true}, 8802 {"", "function inner2(a = eval('')) { }", true},
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
9162 eager_info.literal()->scope()->inner_scope()->inner_scope(); 9174 eager_info.literal()->scope()->inner_scope()->inner_scope();
9163 DCHECK_NOT_NULL(scope); 9175 DCHECK_NOT_NULL(scope);
9164 DCHECK_NULL(scope->sibling()); 9176 DCHECK_NULL(scope->sibling());
9165 DCHECK(scope->is_function_scope()); 9177 DCHECK(scope->is_function_scope());
9166 9178
9167 size_t index = 0; 9179 size_t index = 0;
9168 i::ScopeTestHelper::CompareScopeToData( 9180 i::ScopeTestHelper::CompareScopeToData(
9169 scope, lazy_info.preparsed_scope_data(), index); 9181 scope, lazy_info.preparsed_scope_data(), index);
9170 } 9182 }
9171 } 9183 }
OLDNEW
« 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