| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 library inferrer_visitor; | 5 library inferrer_visitor; |
| 6 | 6 |
| 7 import '../dart2jslib.dart' hide Selector, TypedSelector; | 7 import '../dart2jslib.dart' hide Selector, TypedSelector; |
| 8 import '../dart_types.dart'; | 8 import '../dart_types.dart'; |
| 9 import '../elements/elements.dart'; | 9 import '../elements/elements.dart'; |
| 10 import '../tree/tree.dart'; | 10 import '../tree/tree.dart'; |
| (...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 840 T receiverType = visit(node.receiver); | 840 T receiverType = visit(node.receiver); |
| 841 DartType type = elements.getType(node.arguments.head); | 841 DartType type = elements.getType(node.arguments.head); |
| 842 return types.narrowType(receiverType, type); | 842 return types.narrowType(receiverType, type); |
| 843 } else if (node.argumentsNode is Prefix) { | 843 } else if (node.argumentsNode is Prefix) { |
| 844 // Unary operator. | 844 // Unary operator. |
| 845 return visitDynamicSend(node); | 845 return visitDynamicSend(node); |
| 846 } else if ('===' == op.source | 846 } else if ('===' == op.source |
| 847 || '!==' == op.source) { | 847 || '!==' == op.source) { |
| 848 node.visitChildren(this); | 848 node.visitChildren(this); |
| 849 return types.boolType; | 849 return types.boolType; |
| 850 } else if ('!=' == op.source) { |
| 851 visitDynamicSend(node); |
| 852 return types.boolType; |
| 850 } else { | 853 } else { |
| 851 // Binary operator. | 854 // Binary operator. |
| 852 return visitDynamicSend(node); | 855 return visitDynamicSend(node); |
| 853 } | 856 } |
| 854 } | 857 } |
| 855 | 858 |
| 856 // Because some nodes just visit their children, we may end up | 859 // Because some nodes just visit their children, we may end up |
| 857 // visiting a type annotation, that may contain a send in case of a | 860 // visiting a type annotation, that may contain a send in case of a |
| 858 // prefixed type. Therefore we explicitly visit the type annotation | 861 // prefixed type. Therefore we explicitly visit the type annotation |
| 859 // to avoid confusing the [ResolvedVisitor]. | 862 // to avoid confusing the [ResolvedVisitor]. |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1151 return type; | 1154 return type; |
| 1152 } | 1155 } |
| 1153 | 1156 |
| 1154 T visitCascade(Cascade node) { | 1157 T visitCascade(Cascade node) { |
| 1155 // Ignore the result of the cascade send and return the type of the cascade | 1158 // Ignore the result of the cascade send and return the type of the cascade |
| 1156 // receiver. | 1159 // receiver. |
| 1157 visit(node.expression); | 1160 visit(node.expression); |
| 1158 return cascadeReceiverStack.removeLast(); | 1161 return cascadeReceiverStack.removeLast(); |
| 1159 } | 1162 } |
| 1160 } | 1163 } |
| OLD | NEW |