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 '../constants/expressions.dart'; | 8 import '../constants/expressions.dart'; |
9 import '../common.dart'; | 9 import '../common.dart'; |
10 import '../common/names.dart'; | 10 import '../common/names.dart'; |
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 @override | 642 @override |
643 DartType visitFunctionType(ir.FunctionType node) { | 643 DartType visitFunctionType(ir.FunctionType node) { |
644 return new FunctionType.synthesized( | 644 return new FunctionType.synthesized( |
645 visitType(node.returnType), | 645 visitType(node.returnType), |
646 visitTypes(node.positionalParameters | 646 visitTypes(node.positionalParameters |
647 .take(node.requiredParameterCount) | 647 .take(node.requiredParameterCount) |
648 .toList()), | 648 .toList()), |
649 visitTypes(node.positionalParameters | 649 visitTypes(node.positionalParameters |
650 .skip(node.requiredParameterCount) | 650 .skip(node.requiredParameterCount) |
651 .toList()), | 651 .toList()), |
652 node.namedParameters.map((n) => n.name).toList(), | 652 node.namedParameters.keys.toList(), |
653 node.namedParameters.map((n) => visitType(n.type)).toList()); | 653 visitTypes(node.namedParameters.values.toList())); |
654 } | 654 } |
655 | 655 |
656 @override | 656 @override |
657 DartType visitInterfaceType(ir.InterfaceType node) { | 657 DartType visitInterfaceType(ir.InterfaceType node) { |
658 ClassElement cls = astAdapter.getElement(node.classNode); | 658 ClassElement cls = astAdapter.getElement(node.classNode); |
659 return new InterfaceType(cls, visitTypes(node.typeArguments)); | 659 return new InterfaceType(cls, visitTypes(node.typeArguments)); |
660 } | 660 } |
661 | 661 |
662 @override | 662 @override |
663 DartType visitVoidType(ir.VoidType node) { | 663 DartType visitVoidType(ir.VoidType node) { |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 astAdapter.reporter.internalError( | 739 astAdapter.reporter.internalError( |
740 CURRENT_ELEMENT_SPANNABLE, "Unexpected constant target: $element."); | 740 CURRENT_ELEMENT_SPANNABLE, "Unexpected constant target: $element."); |
741 return null; | 741 return null; |
742 } | 742 } |
743 | 743 |
744 @override | 744 @override |
745 ConstantExpression visitStringLiteral(ir.StringLiteral node) { | 745 ConstantExpression visitStringLiteral(ir.StringLiteral node) { |
746 return new StringConstantExpression(node.value); | 746 return new StringConstantExpression(node.value); |
747 } | 747 } |
748 } | 748 } |
OLD | NEW |