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 4441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4452 catch_scope->DeclareLocal(ast_value_factory()->dot_catch_string(), VAR, | 4452 catch_scope->DeclareLocal(ast_value_factory()->dot_catch_string(), VAR, |
4453 kCreatedInitialized, Variable::NORMAL); | 4453 kCreatedInitialized, Variable::NORMAL); |
4454 Block* catch_block = factory()->NewBlock(nullptr, 1, true, kNoSourcePosition); | 4454 Block* catch_block = factory()->NewBlock(nullptr, 1, true, kNoSourcePosition); |
4455 | 4455 |
4456 Expression* promise_reject = BuildRejectPromise( | 4456 Expression* promise_reject = BuildRejectPromise( |
4457 factory()->NewVariableProxy(catch_variable), kNoSourcePosition); | 4457 factory()->NewVariableProxy(catch_variable), kNoSourcePosition); |
4458 ReturnStatement* return_promise_reject = | 4458 ReturnStatement* return_promise_reject = |
4459 factory()->NewReturnStatement(promise_reject, kNoSourcePosition); | 4459 factory()->NewReturnStatement(promise_reject, kNoSourcePosition); |
4460 catch_block->statements()->Add(return_promise_reject, zone()); | 4460 catch_block->statements()->Add(return_promise_reject, zone()); |
4461 | 4461 |
4462 TryStatement* try_catch_statement = factory()->NewTryCatchStatement( | 4462 TryStatement* try_catch_statement = |
4463 inner_block, catch_scope, catch_variable, catch_block, kNoSourcePosition); | 4463 factory()->NewTryCatchStatementForAsyncAwait(inner_block, catch_scope, |
| 4464 catch_variable, catch_block, |
| 4465 kNoSourcePosition); |
4464 | 4466 |
4465 // There is no TryCatchFinally node, so wrap it in an outer try/finally | 4467 // There is no TryCatchFinally node, so wrap it in an outer try/finally |
4466 Block* outer_try_block = | 4468 Block* outer_try_block = |
4467 factory()->NewBlock(nullptr, 1, true, kNoSourcePosition); | 4469 factory()->NewBlock(nullptr, 1, true, kNoSourcePosition); |
4468 outer_try_block->statements()->Add(try_catch_statement, zone()); | 4470 outer_try_block->statements()->Add(try_catch_statement, zone()); |
4469 | 4471 |
4470 // finally { if (.debug_is_active) %DebugPopPromise(); } | 4472 // finally { if (.debug_is_active) %DebugPopPromise(); } |
4471 Block* finally_block = | 4473 Block* finally_block = |
4472 factory()->NewBlock(nullptr, 1, true, kNoSourcePosition); | 4474 factory()->NewBlock(nullptr, 1, true, kNoSourcePosition); |
4473 { | 4475 { |
(...skipping 2273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6747 node->Print(Isolate::Current()); | 6749 node->Print(Isolate::Current()); |
6748 } | 6750 } |
6749 #endif // DEBUG | 6751 #endif // DEBUG |
6750 | 6752 |
6751 #undef CHECK_OK | 6753 #undef CHECK_OK |
6752 #undef CHECK_OK_VOID | 6754 #undef CHECK_OK_VOID |
6753 #undef CHECK_FAILED | 6755 #undef CHECK_FAILED |
6754 | 6756 |
6755 } // namespace internal | 6757 } // namespace internal |
6756 } // namespace v8 | 6758 } // namespace v8 |
OLD | NEW |