OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |