| 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 1484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1495 value?.parent = this; | 1495 value?.parent = this; |
| 1496 } | 1496 } |
| 1497 } | 1497 } |
| 1498 | 1498 |
| 1499 accept(ExpressionVisitor v) => v.visitDirectPropertySet(this); | 1499 accept(ExpressionVisitor v) => v.visitDirectPropertySet(this); |
| 1500 | 1500 |
| 1501 DartType getStaticType(TypeEnvironment types) => value.getStaticType(types); | 1501 DartType getStaticType(TypeEnvironment types) => value.getStaticType(types); |
| 1502 } | 1502 } |
| 1503 | 1503 |
| 1504 /// Directly call an instance method, bypassing ordinary dispatch. | 1504 /// Directly call an instance method, bypassing ordinary dispatch. |
| 1505 class DirectMethodInvocation extends Expression { | 1505 class DirectMethodInvocation extends InvocationExpression { |
| 1506 Expression receiver; | 1506 Expression receiver; |
| 1507 Procedure target; | 1507 Procedure target; |
| 1508 Arguments arguments; | 1508 Arguments arguments; |
| 1509 | 1509 |
| 1510 DirectMethodInvocation(this.receiver, this.target, this.arguments) { | 1510 DirectMethodInvocation(this.receiver, this.target, this.arguments) { |
| 1511 receiver?.parent = this; | 1511 receiver?.parent = this; |
| 1512 arguments?.parent = this; | 1512 arguments?.parent = this; |
| 1513 } | 1513 } |
| 1514 | 1514 |
| 1515 Name get name => target?.name; |
| 1516 |
| 1515 visitChildren(Visitor v) { | 1517 visitChildren(Visitor v) { |
| 1516 receiver?.accept(v); | 1518 receiver?.accept(v); |
| 1517 target?.acceptReference(v); | 1519 target?.acceptReference(v); |
| 1518 arguments?.accept(v); | 1520 arguments?.accept(v); |
| 1519 } | 1521 } |
| 1520 | 1522 |
| 1521 transformChildren(Transformer v) { | 1523 transformChildren(Transformer v) { |
| 1522 if (receiver != null) { | 1524 if (receiver != null) { |
| 1523 receiver = receiver.accept(v); | 1525 receiver = receiver.accept(v); |
| 1524 receiver?.parent = this; | 1526 receiver?.parent = this; |
| (...skipping 2119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3644 | 3646 |
| 3645 @override | 3647 @override |
| 3646 defaultTreeNode(TreeNode node) { | 3648 defaultTreeNode(TreeNode node) { |
| 3647 if (node == child) { | 3649 if (node == child) { |
| 3648 return replacement; | 3650 return replacement; |
| 3649 } else { | 3651 } else { |
| 3650 return node; | 3652 return node; |
| 3651 } | 3653 } |
| 3652 } | 3654 } |
| 3653 } | 3655 } |
| OLD | NEW |