| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 part of dart2js; | 5 part of dart2js; |
| 6 | 6 |
| 7 /// Enum for the visit methods added in [ResolvedVisitor]. | 7 /// Enum for the visit methods added in [ResolvedVisitor]. |
| 8 // TODO(johnniwinther): Remove this. | 8 // TODO(johnniwinther): Remove this. |
| 9 enum ResolvedKind { | 9 enum ResolvedKind { |
| 10 ASSERT, | 10 ASSERT, |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 if (!Elements.isUnresolved(element) && element.impliesType) { | 109 if (!Elements.isUnresolved(element) && element.impliesType) { |
| 110 return visitor.visitTypePrefixSend(node); | 110 return visitor.visitTypePrefixSend(node); |
| 111 } else { | 111 } else { |
| 112 return visitor.visitGetterSend(node); | 112 return visitor.visitGetterSend(node); |
| 113 } | 113 } |
| 114 } else if (element != null && Initializers.isConstructorRedirect(node)) { | 114 } else if (element != null && Initializers.isConstructorRedirect(node)) { |
| 115 return visitor.visitStaticSend(node); | 115 return visitor.visitStaticSend(node); |
| 116 } else if (Elements.isClosureSend(node, element)) { | 116 } else if (Elements.isClosureSend(node, element)) { |
| 117 return visitor.visitClosureSend(node); | 117 return visitor.visitClosureSend(node); |
| 118 } else { | 118 } else { |
| 119 if (Elements.isUnresolved(element)) { | 119 if (node.isConditional) { |
| 120 return visitor.visitDynamicSend(node); |
| 121 } else if (Elements.isUnresolved(element)) { |
| 120 if (element == null) { | 122 if (element == null) { |
| 121 // Example: f() with 'f' unbound. | 123 // Example: f() with 'f' unbound. |
| 122 // This can only happen inside an instance method. | 124 // This can only happen inside an instance method. |
| 123 return visitor.visitDynamicSend(node); | 125 return visitor.visitDynamicSend(node); |
| 124 } else { | 126 } else { |
| 125 return visitor.visitStaticSend(node); | 127 return visitor.visitStaticSend(node); |
| 126 } | 128 } |
| 127 } else if (element.isInstanceMember) { | 129 } else if (element.isInstanceMember) { |
| 128 // Example: f() with 'f' bound to instance method. | 130 // Example: f() with 'f' bound to instance method. |
| 129 return visitor.visitDynamicSend(node); | 131 return visitor.visitDynamicSend(node); |
| (...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 788 | 790 |
| 789 @override | 791 @override |
| 790 R visitSuperIndex( | 792 R visitSuperIndex( |
| 791 Send node, | 793 Send node, |
| 792 FunctionElement function, | 794 FunctionElement function, |
| 793 Node index, | 795 Node index, |
| 794 ResolvedKindVisitor<R> visitor) { | 796 ResolvedKindVisitor<R> visitor) { |
| 795 return visitor.visitSuperSend(node); | 797 return visitor.visitSuperSend(node); |
| 796 } | 798 } |
| 797 } | 799 } |
| OLD | NEW |