| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 dart2js.kernel.element_map; | 5 library dart2js.kernel.element_map; |
| 6 | 6 |
| 7 import 'package:kernel/ast.dart' as ir; | 7 import 'package:kernel/ast.dart' as ir; |
| 8 | 8 |
| 9 import '../common.dart'; | 9 import '../common.dart'; |
| 10 import '../common/names.dart' show Identifiers; | 10 import '../common/names.dart' show Identifiers; |
| (...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 889 // TODO(johnniwinther): Cache the computed function type. | 889 // TODO(johnniwinther): Cache the computed function type. |
| 890 int requiredParameters = node.requiredParameterCount; | 890 int requiredParameters = node.requiredParameterCount; |
| 891 int positionalParameters = node.positionalParameters.length; | 891 int positionalParameters = node.positionalParameters.length; |
| 892 List<String> namedParameters = | 892 List<String> namedParameters = |
| 893 node.namedParameters.map((p) => p.name).toList()..sort(); | 893 node.namedParameters.map((p) => p.name).toList()..sort(); |
| 894 return new ParameterStructure( | 894 return new ParameterStructure( |
| 895 requiredParameters, positionalParameters, namedParameters); | 895 requiredParameters, positionalParameters, namedParameters); |
| 896 } | 896 } |
| 897 | 897 |
| 898 Local _getLocalFunction(ir.TreeNode node) { | 898 Local _getLocalFunction(ir.TreeNode node) { |
| 899 assert( |
| 900 node is ir.FunctionDeclaration || node is ir.FunctionExpression, |
| 901 failedAt( |
| 902 CURRENT_ELEMENT_SPANNABLE, 'Invalid local function node: $node')); |
| 899 return _localFunctionMap.putIfAbsent(node, () { | 903 return _localFunctionMap.putIfAbsent(node, () { |
| 900 MemberEntity memberContext; | 904 MemberEntity memberContext; |
| 901 Entity executableContext; | 905 Entity executableContext; |
| 902 ir.TreeNode parent = node.parent; | 906 ir.TreeNode parent = node.parent; |
| 903 while (parent != null) { | 907 while (parent != null) { |
| 904 if (parent is ir.Member) { | 908 if (parent is ir.Member) { |
| 905 executableContext = memberContext = getMember(parent); | 909 executableContext = memberContext = getMember(parent); |
| 906 break; | 910 break; |
| 907 } | 911 } |
| 908 if (parent is ir.FunctionDeclaration || | 912 if (parent is ir.FunctionDeclaration || |
| (...skipping 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2027 if (data.constructorBody != null) { | 2031 if (data.constructorBody != null) { |
| 2028 f(data.constructorBody); | 2032 f(data.constructorBody); |
| 2029 } | 2033 } |
| 2030 }); | 2034 }); |
| 2031 } | 2035 } |
| 2032 | 2036 |
| 2033 String getDeferredUri(ir.LibraryDependency node) { | 2037 String getDeferredUri(ir.LibraryDependency node) { |
| 2034 throw new UnimplementedError('JsKernelToElementMap.getDeferredUri'); | 2038 throw new UnimplementedError('JsKernelToElementMap.getDeferredUri'); |
| 2035 } | 2039 } |
| 2036 } | 2040 } |
| OLD | NEW |