OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/ast_transformer.h" | 5 #include "vm/ast_transformer.h" |
6 | 6 |
7 #include "vm/object_store.h" | 7 #include "vm/object_store.h" |
8 #include "vm/parser.h" | 8 #include "vm/parser.h" |
9 #include "vm/thread.h" | 9 #include "vm/thread.h" |
10 | 10 |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 // to determine if a breakpoint is inside an asynchronous function. | 200 // to determine if a breakpoint is inside an asynchronous function. |
201 LoadLocalNode* load_async_op = new (Z) LoadLocalNode(token_pos, async_op); | 201 LoadLocalNode* load_async_op = new (Z) LoadLocalNode(token_pos, async_op); |
202 preamble_->Add(load_async_op); | 202 preamble_->Add(load_async_op); |
203 | 203 |
204 LoadLocalNode* load_error_param = | 204 LoadLocalNode* load_error_param = |
205 new (Z) LoadLocalNode(token_pos, error_param); | 205 new (Z) LoadLocalNode(token_pos, error_param); |
206 LoadLocalNode* load_stack_trace_param = | 206 LoadLocalNode* load_stack_trace_param = |
207 new (Z) LoadLocalNode(token_pos, stack_trace_param); | 207 new (Z) LoadLocalNode(token_pos, stack_trace_param); |
208 SequenceNode* error_ne_null_branch = | 208 SequenceNode* error_ne_null_branch = |
209 new (Z) SequenceNode(token_pos, ChainNewScope(preamble_->scope())); | 209 new (Z) SequenceNode(token_pos, ChainNewScope(preamble_->scope())); |
210 error_ne_null_branch->Add( | 210 error_ne_null_branch->Add(new (Z) ThrowNode( |
211 new (Z) ThrowNode(token_pos, load_error_param, load_stack_trace_param)); | 211 node->token_pos(), load_error_param, load_stack_trace_param)); |
212 preamble_->Add(new (Z) IfNode( | 212 preamble_->Add(new (Z) IfNode( |
213 token_pos, new (Z) ComparisonNode( | 213 token_pos, new (Z) ComparisonNode( |
214 token_pos, Token::kNE, load_error_param, | 214 token_pos, Token::kNE, load_error_param, |
215 new (Z) LiteralNode(token_pos, Object::null_instance())), | 215 new (Z) LiteralNode(token_pos, Object::null_instance())), |
216 error_ne_null_branch, NULL)); | 216 error_ne_null_branch, NULL)); |
217 | 217 |
218 result_ = MakeName(new (Z) LoadLocalNode(token_pos, result_param)); | 218 result_ = MakeName(new (Z) LoadLocalNode(token_pos, result_param)); |
219 } | 219 } |
220 | 220 |
221 | 221 |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 } | 507 } |
508 | 508 |
509 | 509 |
510 void AwaitTransformer::VisitThrowNode(ThrowNode* node) { | 510 void AwaitTransformer::VisitThrowNode(ThrowNode* node) { |
511 AstNode* new_exception = Transform(node->exception()); | 511 AstNode* new_exception = Transform(node->exception()); |
512 result_ = MakeName( | 512 result_ = MakeName( |
513 new (Z) ThrowNode(node->token_pos(), new_exception, node->stacktrace())); | 513 new (Z) ThrowNode(node->token_pos(), new_exception, node->stacktrace())); |
514 } | 514 } |
515 | 515 |
516 } // namespace dart | 516 } // namespace dart |
OLD | NEW |