| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 /// ----------------------------------------------------------------------- | 5 /// ----------------------------------------------------------------------- |
| 6 /// ERROR HANDLING | 6 /// ERROR HANDLING |
| 7 /// ----------------------------------------------------------------------- | 7 /// ----------------------------------------------------------------------- |
| 8 /// | 8 /// |
| 9 /// As a rule of thumb, errors that can be detected statically are handled by | 9 /// As a rule of thumb, errors that can be detected statically are handled by |
| 10 /// the frontend, typically by translating the erroneous code into a 'throw' or | 10 /// the frontend, typically by translating the erroneous code into a 'throw' or |
| (...skipping 2437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2448 | 2448 |
| 2449 accept(StatementVisitor v) => v.visitBlock(this); | 2449 accept(StatementVisitor v) => v.visitBlock(this); |
| 2450 | 2450 |
| 2451 visitChildren(Visitor v) { | 2451 visitChildren(Visitor v) { |
| 2452 visitList(statements, v); | 2452 visitList(statements, v); |
| 2453 } | 2453 } |
| 2454 | 2454 |
| 2455 transformChildren(Transformer v) { | 2455 transformChildren(Transformer v) { |
| 2456 transformList(statements, v, this); | 2456 transformList(statements, v, this); |
| 2457 } | 2457 } |
| 2458 |
| 2459 void addStatement(Statement node) { |
| 2460 statements.add(node); |
| 2461 node.parent = this; |
| 2462 } |
| 2458 } | 2463 } |
| 2459 | 2464 |
| 2460 class EmptyStatement extends Statement { | 2465 class EmptyStatement extends Statement { |
| 2461 accept(StatementVisitor v) => v.visitEmptyStatement(this); | 2466 accept(StatementVisitor v) => v.visitEmptyStatement(this); |
| 2462 | 2467 |
| 2463 visitChildren(Visitor v) {} | 2468 visitChildren(Visitor v) {} |
| 2464 transformChildren(Transformer v) {} | 2469 transformChildren(Transformer v) {} |
| 2465 } | 2470 } |
| 2466 | 2471 |
| 2467 class AssertStatement extends Statement { | 2472 class AssertStatement extends Statement { |
| (...skipping 1133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3601 | 3606 |
| 3602 @override | 3607 @override |
| 3603 defaultTreeNode(TreeNode node) { | 3608 defaultTreeNode(TreeNode node) { |
| 3604 if (node == child) { | 3609 if (node == child) { |
| 3605 return replacement; | 3610 return replacement; |
| 3606 } else { | 3611 } else { |
| 3607 return node; | 3612 return node; |
| 3608 } | 3613 } |
| 3609 } | 3614 } |
| 3610 } | 3615 } |
| OLD | NEW |