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

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

Issue 2654163008: [parser] Skipping inner funcs: add tests for variables called "arguments" (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 9057 matching lines...) Expand 10 before | Expand all | Expand 10 after
9068 {"", "const var1 = 5; function f() { var1; }"}, 9068 {"", "const var1 = 5; function f() { var1; }"},
9069 9069
9070 {"", "var var1; var var1;"}, 9070 {"", "var var1; var var1;"},
9071 {"", "var var1; var var1; var1 = 5;"}, 9071 {"", "var var1; var var1; var1 = 5;"},
9072 {"", "var var1; if (true) { var var1; }"}, 9072 {"", "var var1; if (true) { var var1; }"},
9073 {"", "if (true) { var var1; var var1; }"}, 9073 {"", "if (true) { var var1; var var1; }"},
9074 {"", "var var1; if (true) { var var1; var1 = 5; }"}, 9074 {"", "var var1; if (true) { var var1; var1 = 5; }"},
9075 {"", "if (true) { var var1; var var1; var1 = 5; }"}, 9075 {"", "if (true) { var var1; var var1; var1 = 5; }"},
9076 {"", "var var1; var var1; function f() { var1; }"}, 9076 {"", "var var1; var var1; function f() { var1; }"},
9077 {"", "var var1; var var1; function f() { var1 = 5; }"}, 9077 {"", "var var1; var var1; function f() { var1 = 5; }"},
9078
9079 {"", "arguments;"},
9080 {"", "arguments = 5;"},
9081 {"", "function f() { arguments; }"},
9082 {"", "function f() { arguments = 5; }"},
9083
9084 {"", "var arguments;"},
9085 {"", "var arguments; arguments = 5;"},
9086 {"", "if (true) { var arguments; }"},
9087 {"", "if (true) { var arguments; arguments = 5; }"},
9088 {"", "var arguments; function f() { arguments; }"},
9089 {"", "var arguments; arguments = 5; function f() { arguments; }"},
9090 {"", "var arguments; function f() { arguments = 5; }"},
9091
9092 {"", "let arguments;"},
9093 {"", "let arguments; arguments = 5;"},
9094 {"", "if (true) { let arguments; }"},
9095 {"", "if (true) { let arguments; arguments = 5; }"},
9096 {"", "let arguments; function f() { arguments; }"},
9097 {"", "let arguments; arguments = 5; function f() { arguments; }"},
9098 {"", "let arguments; function f() { arguments = 5; }"},
9099
9100 {"", "const arguments = 5;"},
9101 {"", "if (true) { const arguments = 5; }"},
9102 {"", "const arguments = 5; function f() { arguments; }"},
9078 }; 9103 };
9079 9104
9080 for (unsigned i = 0; i < arraysize(inners); ++i) { 9105 for (unsigned i = 0; i < arraysize(inners); ++i) {
9081 // First compile with the lazy inner function and extract the scope data. 9106 // First compile with the lazy inner function and extract the scope data.
9082 const char* inner_function = lazy_inner; 9107 const char* inner_function = lazy_inner;
9083 int inner_function_len = Utf8LengthHelper(inner_function) - 4; 9108 int inner_function_len = Utf8LengthHelper(inner_function) - 4;
9084 9109
9085 int params_len = Utf8LengthHelper(inners[i].params); 9110 int params_len = Utf8LengthHelper(inners[i].params);
9086 int source_len = Utf8LengthHelper(inners[i].source); 9111 int source_len = Utf8LengthHelper(inners[i].source);
9087 int len = 9112 int len =
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
9137 eager_info.literal()->scope()->inner_scope()->inner_scope(); 9162 eager_info.literal()->scope()->inner_scope()->inner_scope();
9138 DCHECK_NOT_NULL(scope); 9163 DCHECK_NOT_NULL(scope);
9139 DCHECK_NULL(scope->sibling()); 9164 DCHECK_NULL(scope->sibling());
9140 DCHECK(scope->is_function_scope()); 9165 DCHECK(scope->is_function_scope());
9141 9166
9142 size_t index = 0; 9167 size_t index = 0;
9143 i::ScopeTestHelper::CompareScopeToData( 9168 i::ScopeTestHelper::CompareScopeToData(
9144 scope, lazy_info.preparsed_scope_data(), index); 9169 scope, lazy_info.preparsed_scope_data(), index);
9145 } 9170 }
9146 } 9171 }
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