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

Side by Side Diff: src/parsing/parser.cc

Issue 2669163002: [parser] Skipping inner funcs: produce the same scopes / variables for (some) loops. (Closed)
Patch Set: code review (vogelheim@) 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 | src/parsing/parser-base.h » ('j') | 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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/parsing/parser.h" 5 #include "src/parsing/parser.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "src/api.h" 9 #include "src/api.h"
10 #include "src/ast/ast-expression-rewriter.h" 10 #include "src/ast/ast-expression-rewriter.h"
(...skipping 2365 matching lines...) Expand 10 before | Expand all | Expand 10 after
2376 factory()->NewBreakStatement(outer_loop, kNoSourcePosition); 2376 factory()->NewBreakStatement(outer_loop, kNoSourcePosition);
2377 Statement* empty = factory()->NewEmptyStatement(kNoSourcePosition); 2377 Statement* empty = factory()->NewEmptyStatement(kNoSourcePosition);
2378 Statement* if_flag_break = 2378 Statement* if_flag_break =
2379 factory()->NewIfStatement(compare, stop, empty, kNoSourcePosition); 2379 factory()->NewIfStatement(compare, stop, empty, kNoSourcePosition);
2380 Block* ignore_completion_block = 2380 Block* ignore_completion_block =
2381 factory()->NewBlock(NULL, 1, true, kNoSourcePosition); 2381 factory()->NewBlock(NULL, 1, true, kNoSourcePosition);
2382 ignore_completion_block->statements()->Add(if_flag_break, zone()); 2382 ignore_completion_block->statements()->Add(if_flag_break, zone());
2383 inner_block->statements()->Add(ignore_completion_block, zone()); 2383 inner_block->statements()->Add(ignore_completion_block, zone());
2384 } 2384 }
2385 2385
2386 inner_scope->set_end_position(scanner()->location().end_pos);
2387 inner_block->set_scope(inner_scope); 2386 inner_block->set_scope(inner_scope);
2388 } 2387 }
2389 2388
2390 outer_loop->Initialize(NULL, NULL, NULL, inner_block); 2389 outer_loop->Initialize(NULL, NULL, NULL, inner_block);
2391 return outer_block; 2390 return outer_block;
2392 } 2391 }
2393 2392
2394 void Parser::AddArrowFunctionFormalParameters( 2393 void Parser::AddArrowFunctionFormalParameters(
2395 ParserFormalParameters* parameters, Expression* expr, int end_pos, 2394 ParserFormalParameters* parameters, Expression* expr, int end_pos,
2396 bool* ok) { 2395 bool* ok) {
(...skipping 2632 matching lines...) Expand 10 before | Expand all | Expand 10 after
5029 5028
5030 return final_loop; 5029 return final_loop;
5031 } 5030 }
5032 5031
5033 #undef CHECK_OK 5032 #undef CHECK_OK
5034 #undef CHECK_OK_VOID 5033 #undef CHECK_OK_VOID
5035 #undef CHECK_FAILED 5034 #undef CHECK_FAILED
5036 5035
5037 } // namespace internal 5036 } // namespace internal
5038 } // namespace v8 5037 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/parsing/parser-base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698