| 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 import 'package:js_runtime/shared/embedded_names.dart'; | 5 import 'package:js_runtime/shared/embedded_names.dart'; |
| 6 import 'package:kernel/ast.dart' as ir; | 6 import 'package:kernel/ast.dart' as ir; |
| 7 | 7 |
| 8 import '../common.dart'; | 8 import '../common.dart'; |
| 9 import '../common/names.dart'; | 9 import '../common/names.dart'; |
| 10 import '../compiler.dart'; | 10 import '../compiler.dart'; |
| (...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 | 631 |
| 632 ResolutionDartType getDartTypeIfValid(ir.DartType type) { | 632 ResolutionDartType getDartTypeIfValid(ir.DartType type) { |
| 633 if (type is ir.InvalidType) return null; | 633 if (type is ir.InvalidType) return null; |
| 634 return _typeConverter.convert(type); | 634 return _typeConverter.convert(type); |
| 635 } | 635 } |
| 636 | 636 |
| 637 List<ResolutionDartType> getDartTypes(List<ir.DartType> types) { | 637 List<ResolutionDartType> getDartTypes(List<ir.DartType> types) { |
| 638 return types.map(getDartType).toList(); | 638 return types.map(getDartType).toList(); |
| 639 } | 639 } |
| 640 | 640 |
| 641 ResolutionDartType getDartTypeOfListLiteral(ir.ListLiteral list) { | 641 ResolutionInterfaceType getDartTypeOfListLiteral(ir.ListLiteral list) { |
| 642 ast.Node node = getNodeOrNull(list); | 642 ast.Node node = getNodeOrNull(list); |
| 643 if (node != null) return elements.getType(node); | 643 if (node != null) return elements.getType(node); |
| 644 assertNodeIsSynthetic(list); | 644 assertNodeIsSynthetic(list); |
| 645 return _compiler.commonElements.listType(getDartType(list.typeArgument)); | 645 return _compiler.commonElements.listType(getDartType(list.typeArgument)); |
| 646 } | 646 } |
| 647 | 647 |
| 648 ResolutionDartType getDartTypeOfMapLiteral(ir.MapLiteral literal) { | 648 ResolutionInterfaceType getDartTypeOfMapLiteral(ir.MapLiteral literal) { |
| 649 ast.Node node = getNodeOrNull(literal); | 649 ast.Node node = getNodeOrNull(literal); |
| 650 if (node != null) return elements.getType(node); | 650 if (node != null) return elements.getType(node); |
| 651 assertNodeIsSynthetic(literal); | 651 assertNodeIsSynthetic(literal); |
| 652 return _compiler.commonElements | 652 return _compiler.commonElements |
| 653 .mapType(getDartType(literal.keyType), getDartType(literal.valueType)); | 653 .mapType(getDartType(literal.keyType), getDartType(literal.valueType)); |
| 654 } | 654 } |
| 655 | 655 |
| 656 ResolutionDartType getFunctionReturnType(ir.FunctionNode node) { | 656 ResolutionDartType getFunctionReturnType(ir.FunctionNode node) { |
| 657 if (node.returnType is ir.InvalidType) return const ResolutionDynamicType(); | 657 if (node.returnType is ir.InvalidType) return const ResolutionDynamicType(); |
| 658 return getDartType(node.returnType); | 658 return getDartType(node.returnType); |
| (...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1199 JumpTarget continueTarget = | 1199 JumpTarget continueTarget = |
| 1200 astAdapter.getJumpTarget(switchCase, isContinueTarget: true); | 1200 astAdapter.getJumpTarget(switchCase, isContinueTarget: true); |
| 1201 assert(continueTarget is KernelJumpTarget); | 1201 assert(continueTarget is KernelJumpTarget); |
| 1202 targetIndexMap[continueTarget] = switchIndex; | 1202 targetIndexMap[continueTarget] = switchIndex; |
| 1203 assert(builder.jumpTargets[continueTarget] == null); | 1203 assert(builder.jumpTargets[continueTarget] == null); |
| 1204 builder.jumpTargets[continueTarget] = this; | 1204 builder.jumpTargets[continueTarget] = this; |
| 1205 switchIndex++; | 1205 switchIndex++; |
| 1206 } | 1206 } |
| 1207 } | 1207 } |
| 1208 } | 1208 } |
| OLD | NEW |