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

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

Issue 2683563002: [parser] Skipping inner funcs: produce the same scopes / variables for this expressions. (Closed)
Patch Set: oops cannot assign this 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/parsing/preparser.h ('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 9240 matching lines...) Expand 10 before | Expand all | Expand 10 after
9251 {"", "var var1; var var1; function f() { var1 = 5; }"}, 9251 {"", "var var1; var var1; function f() { var1 = 5; }"},
9252 9252
9253 // Shadowing declarations. 9253 // Shadowing declarations.
9254 {"", "var var1; if (true) { var var1; }"}, 9254 {"", "var var1; if (true) { var var1; }"},
9255 {"", "var var1; if (true) { let var1; }"}, 9255 {"", "var var1; if (true) { let var1; }"},
9256 {"", "let var1; if (true) { let var1; }"}, 9256 {"", "let var1; if (true) { let var1; }"},
9257 9257
9258 {"", "var var1; if (true) { const var1 = 0; }"}, 9258 {"", "var var1; if (true) { const var1 = 0; }"},
9259 {"", "const var1 = 0; if (true) { const var1 = 0; }"}, 9259 {"", "const var1 = 0; if (true) { const var1 = 0; }"},
9260 9260
9261 // Variable called "arguments" 9261 // Arguments and this.
9262 {"", "arguments;"}, 9262 {"", "arguments;"},
9263 {"", "arguments = 5;"}, 9263 {"", "arguments = 5;"},
9264 {"", "if (true) { arguments; }"},
9265 {"", "if (true) { arguments = 5; }"},
9264 {"", "function f() { arguments; }"}, 9266 {"", "function f() { arguments; }"},
9265 {"", "function f() { arguments = 5; }"}, 9267 {"", "function f() { arguments = 5; }"},
9266 9268
9269 {"", "this;"},
9270 {"", "if (true) { this; }"},
9271 {"", "function f() { this; }"},
9272
9273 // Variable called "arguments"
9267 {"", "var arguments;"}, 9274 {"", "var arguments;"},
9268 {"", "var arguments; arguments = 5;"}, 9275 {"", "var arguments; arguments = 5;"},
9269 {"", "if (true) { var arguments; }"}, 9276 {"", "if (true) { var arguments; }"},
9270 {"", "if (true) { var arguments; arguments = 5; }"}, 9277 {"", "if (true) { var arguments; arguments = 5; }"},
9271 {"", "var arguments; function f() { arguments; }"}, 9278 {"", "var arguments; function f() { arguments; }"},
9272 {"", "var arguments; arguments = 5; function f() { arguments; }"}, 9279 {"", "var arguments; arguments = 5; function f() { arguments; }"},
9273 {"", "var arguments; function f() { arguments = 5; }"}, 9280 {"", "var arguments; function f() { arguments = 5; }"},
9274 9281
9275 {"", "let arguments;"}, 9282 {"", "let arguments;"},
9276 {"", "let arguments; arguments = 5;"}, 9283 {"", "let arguments; arguments = 5;"},
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
9428 9435
9429 {"", "var var1 = 0; for(var1; var1 < 2; ++var1) { }"}, 9436 {"", "var var1 = 0; for(var1; var1 < 2; ++var1) { }"},
9430 {"", 9437 {"",
9431 "var var1 = 0; for (var1; var1 < 2; ++var1) { function foo() { var1; } " 9438 "var var1 = 0; for (var1; var1 < 2; ++var1) { function foo() { var1; } "
9432 "}"}, 9439 "}"},
9433 {"", "var var1 = 0; for (var1; var1 > 2; ) { }"}, 9440 {"", "var var1 = 0; for (var1; var1 > 2; ) { }"},
9434 {"", "var var1 = 0; for (var1; var1 > 2; ) { function foo() { var1; } }"}, 9441 {"", "var var1 = 0; for (var1; var1 > 2; ) { function foo() { var1; } }"},
9435 {"", 9442 {"",
9436 "var var1 = 0; for (var1; var1 > 2; ) { function foo() { var1 = 6; } }"}, 9443 "var var1 = 0; for (var1; var1 > 2; ) { function foo() { var1 = 6; } }"},
9437 9444
9438 // FIXME(marja): Add test cases for special variables (this, arguments
9439 // etc) referred to in the for loop conditions.
9440
9441 // Sloppy block functions. 9445 // Sloppy block functions.
9442 {"", "if (true) { function f1() {} }"}, 9446 {"", "if (true) { function f1() {} }"},
9443 {"", "if (true) { function f1() {} function f1() {} }"}, 9447 {"", "if (true) { function f1() {} function f1() {} }"},
9444 {"", "if (true) { if (true) { function f1() {} } }"}, 9448 {"", "if (true) { if (true) { function f1() {} } }"},
9445 {"", "if (true) { if (true) { function f1() {} function f1() {} } }"}, 9449 {"", "if (true) { if (true) { function f1() {} function f1() {} } }"},
9446 {"", "if (true) { function f1() {} f1 = 3; }"}, 9450 {"", "if (true) { function f1() {} f1 = 3; }"},
9447 9451
9448 {"", "if (true) { function f1() {} function foo() { f1; } }"}, 9452 {"", "if (true) { function f1() {} function foo() { f1; } }"},
9449 {"", "if (true) { function f1() {} } function foo() { f1; }"}, 9453 {"", "if (true) { function f1() {} } function foo() { f1; }"},
9450 {"", 9454 {"",
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
9528 eager_info.literal()->scope()->inner_scope()->inner_scope(); 9532 eager_info.literal()->scope()->inner_scope()->inner_scope();
9529 DCHECK_NOT_NULL(scope); 9533 DCHECK_NOT_NULL(scope);
9530 DCHECK_NULL(scope->sibling()); 9534 DCHECK_NULL(scope->sibling());
9531 DCHECK(scope->is_function_scope()); 9535 DCHECK(scope->is_function_scope());
9532 9536
9533 size_t index = 0; 9537 size_t index = 0;
9534 i::ScopeTestHelper::CompareScopeToData( 9538 i::ScopeTestHelper::CompareScopeToData(
9535 scope, lazy_info.preparsed_scope_data(), index); 9539 scope, lazy_info.preparsed_scope_data(), index);
9536 } 9540 }
9537 } 9541 }
OLDNEW
« no previous file with comments | « src/parsing/preparser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698