| 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 simple_types_inferrer; | 5 library simple_types_inferrer; |
| 6 | 6 |
| 7 import '../closure.dart' show ClosureClassMap; | 7 import '../closure.dart' show ClosureClassMap; |
| 8 import '../common.dart'; | 8 import '../common.dart'; |
| 9 import '../common/names.dart' show Identifiers, Selectors; | 9 import '../common/names.dart' show Identifiers, Selectors; |
| 10 import '../compiler.dart' show Compiler; | 10 import '../compiler.dart' show Compiler; |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 | 200 |
| 201 TypeInformation visitNode(ast.Node node) { | 201 TypeInformation visitNode(ast.Node node) { |
| 202 return node.visitChildren(this); | 202 return node.visitChildren(this); |
| 203 } | 203 } |
| 204 | 204 |
| 205 TypeInformation visit(ast.Node node) { | 205 TypeInformation visit(ast.Node node) { |
| 206 return node == null ? null : node.accept(this); | 206 return node == null ? null : node.accept(this); |
| 207 } | 207 } |
| 208 | 208 |
| 209 TypeInformation visitLiteralString(ast.LiteralString node) { | 209 TypeInformation visitLiteralString(ast.LiteralString node) { |
| 210 return types.stringLiteralType(node.dartString); | 210 return types.stringLiteralType(node.dartString.slowToString()); |
| 211 } | 211 } |
| 212 | 212 |
| 213 TypeInformation visitStringJuxtaposition(ast.StringJuxtaposition node) { | 213 TypeInformation visitStringJuxtaposition(ast.StringJuxtaposition node) { |
| 214 node.visitChildren(this); | 214 node.visitChildren(this); |
| 215 return types.stringType; | 215 return types.stringType; |
| 216 } | 216 } |
| 217 | 217 |
| 218 TypeInformation visitLiteralBool(ast.LiteralBool node) { | 218 TypeInformation visitLiteralBool(ast.LiteralBool node) { |
| 219 return types.boolLiteralType(node); | 219 return types.boolLiteralType(node.value); |
| 220 } | 220 } |
| 221 | 221 |
| 222 TypeInformation visitLiteralDouble(ast.LiteralDouble node) { | 222 TypeInformation visitLiteralDouble(ast.LiteralDouble node) { |
| 223 ConstantSystem constantSystem = compiler.backend.constantSystem; | 223 ConstantSystem constantSystem = compiler.backend.constantSystem; |
| 224 // The JavaScript backend may turn this literal into an integer at | 224 // The JavaScript backend may turn this literal into an integer at |
| 225 // runtime. | 225 // runtime. |
| 226 return types.getConcreteTypeFor( | 226 return types.getConcreteTypeFor( |
| 227 computeTypeMask(closedWorld, constantSystem.createDouble(node.value))); | 227 computeTypeMask(closedWorld, constantSystem.createDouble(node.value))); |
| 228 } | 228 } |
| 229 | 229 |
| (...skipping 2719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2949 Selector moveNextSelector = Selectors.moveNext; | 2949 Selector moveNextSelector = Selectors.moveNext; |
| 2950 TypeMask moveNextMask = inTreeData.typeOfIteratorMoveNext(node); | 2950 TypeMask moveNextMask = inTreeData.typeOfIteratorMoveNext(node); |
| 2951 | 2951 |
| 2952 TypeInformation iteratorType = handleDynamicSend(node, iteratorSelector, | 2952 TypeInformation iteratorType = handleDynamicSend(node, iteratorSelector, |
| 2953 iteratorMask, expressionType, new ArgumentsTypes.empty()); | 2953 iteratorMask, expressionType, new ArgumentsTypes.empty()); |
| 2954 | 2954 |
| 2955 return handleForInLoop(node, iteratorType, currentSelector, currentMask, | 2955 return handleForInLoop(node, iteratorType, currentSelector, currentMask, |
| 2956 moveNextSelector, moveNextMask); | 2956 moveNextSelector, moveNextMask); |
| 2957 } | 2957 } |
| 2958 } | 2958 } |
| OLD | NEW |