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

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

Issue 2658063005: [parser] Skipping inner funcs: produce correct data for var redeclarations. (Closed)
Patch Set: moar 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 | « src/ast/scopes.cc ('k') | 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 9048 matching lines...) Expand 10 before | Expand all | Expand 10 after
9059 {"", "let var1; var1 = 5;"}, 9059 {"", "let var1; var1 = 5;"},
9060 {"", "if (true) { let var1; }"}, 9060 {"", "if (true) { let var1; }"},
9061 {"", "if (true) { let var1; var1 = 5; }"}, 9061 {"", "if (true) { let var1; var1 = 5; }"},
9062 {"", "let var1; function f() { var1; }"}, 9062 {"", "let var1; function f() { var1; }"},
9063 {"", "let var1; var1 = 5; function f() { var1; }"}, 9063 {"", "let var1; var1 = 5; function f() { var1; }"},
9064 {"", "let var1; function f() { var1 = 5; }"}, 9064 {"", "let var1; function f() { var1 = 5; }"},
9065 9065
9066 {"", "const var1 = 5;"}, 9066 {"", "const var1 = 5;"},
9067 {"", "if (true) { const var1 = 5; }"}, 9067 {"", "if (true) { const var1 = 5; }"},
9068 {"", "const var1 = 5; function f() { var1; }"}, 9068 {"", "const var1 = 5; function f() { var1; }"},
9069
9070 {"", "var var1; var var1;"},
9071 {"", "var var1; var var1; var1 = 5;"},
9072 {"", "var var1; if (true) { var var1; }"},
9073 {"", "if (true) { var var1; var var1; }"},
9074 {"", "var var1; if (true) { var var1; var1 = 5; }"},
9075 {"", "if (true) { var var1; var var1; var1 = 5; }"},
9076 {"", "var var1; var var1; function f() { var1; }"},
9077 {"", "var var1; var var1; function f() { var1 = 5; }"},
9069 }; 9078 };
9070 9079
9071 for (unsigned i = 0; i < arraysize(inners); ++i) { 9080 for (unsigned i = 0; i < arraysize(inners); ++i) {
9072 // First compile with the lazy inner function and extract the scope data. 9081 // First compile with the lazy inner function and extract the scope data.
9073 const char* inner_function = lazy_inner; 9082 const char* inner_function = lazy_inner;
9074 int inner_function_len = Utf8LengthHelper(inner_function) - 4; 9083 int inner_function_len = Utf8LengthHelper(inner_function) - 4;
9075 9084
9076 int params_len = Utf8LengthHelper(inners[i].params); 9085 int params_len = Utf8LengthHelper(inners[i].params);
9077 int source_len = Utf8LengthHelper(inners[i].source); 9086 int source_len = Utf8LengthHelper(inners[i].source);
9078 int len = 9087 int len =
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
9128 eager_info.literal()->scope()->inner_scope()->inner_scope(); 9137 eager_info.literal()->scope()->inner_scope()->inner_scope();
9129 DCHECK_NOT_NULL(scope); 9138 DCHECK_NOT_NULL(scope);
9130 DCHECK_NULL(scope->sibling()); 9139 DCHECK_NULL(scope->sibling());
9131 DCHECK(scope->is_function_scope()); 9140 DCHECK(scope->is_function_scope());
9132 9141
9133 size_t index = 0; 9142 size_t index = 0;
9134 i::ScopeTestHelper::CompareScopeToData( 9143 i::ScopeTestHelper::CompareScopeToData(
9135 scope, lazy_info.preparsed_scope_data(), index); 9144 scope, lazy_info.preparsed_scope_data(), index);
9136 } 9145 }
9137 } 9146 }
OLDNEW
« no previous file with comments | « src/ast/scopes.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698