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 '../closure.dart' show BoxLocal; | 9 import '../closure.dart' show BoxLocal; |
10 import '../common.dart'; | 10 import '../common.dart'; |
(...skipping 2148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2159 KernelClosureClass constructClosureClass( | 2159 KernelClosureClass constructClosureClass( |
2160 MemberEntity member, | 2160 MemberEntity member, |
2161 ir.FunctionNode node, | 2161 ir.FunctionNode node, |
2162 JLibrary enclosingLibrary, | 2162 JLibrary enclosingLibrary, |
2163 KernelScopeInfo info, | 2163 KernelScopeInfo info, |
2164 ir.Location location, | 2164 ir.Location location, |
2165 KernelToLocalsMap localsMap, | 2165 KernelToLocalsMap localsMap, |
2166 InterfaceType supertype) { | 2166 InterfaceType supertype) { |
2167 String name = _computeClosureName(node); | 2167 String name = _computeClosureName(node); |
2168 JClass classEntity = | 2168 JClass classEntity = |
2169 new JClosureClass(localsMap, enclosingLibrary, _classEnvs.length, name); | 2169 new JClosureClass(enclosingLibrary, _classEnvs.length, name); |
2170 _classList.add(classEntity); | 2170 _classList.add(classEntity); |
2171 Map<String, MemberEntity> memberMap = <String, MemberEntity>{}; | 2171 Map<String, MemberEntity> memberMap = <String, MemberEntity>{}; |
2172 _classEnvs.add(new ClosureClassEnv(memberMap)); | 2172 _classEnvs.add(new ClosureClassEnv(memberMap)); |
2173 | 2173 |
2174 // Create a classData and set up the interfaces and subclass | 2174 // Create a classData and set up the interfaces and subclass |
2175 // relationships that _ensureSupertypes and _ensureThisAndRawType are doing | 2175 // relationships that _ensureSupertypes and _ensureThisAndRawType are doing |
2176 var closureData = new ClassData( | 2176 var closureData = new ClassData( |
2177 null, | 2177 null, |
2178 new ClosureClassDefinition( | 2178 new ClosureClassDefinition( |
2179 classEntity, computeSourceSpanFromTreeNode(node))); | 2179 classEntity, computeSourceSpanFromTreeNode(node))); |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2310 /// | 2310 /// |
2311 /// These names are not used in generated code, just as element name. | 2311 /// These names are not used in generated code, just as element name. |
2312 String _getClosureVariableName(String name, int id) { | 2312 String _getClosureVariableName(String name, int id) { |
2313 return "_captured_${name}_$id"; | 2313 return "_captured_${name}_$id"; |
2314 } | 2314 } |
2315 | 2315 |
2316 String getDeferredUri(ir.LibraryDependency node) { | 2316 String getDeferredUri(ir.LibraryDependency node) { |
2317 throw new UnimplementedError('JsKernelToElementMap.getDeferredUri'); | 2317 throw new UnimplementedError('JsKernelToElementMap.getDeferredUri'); |
2318 } | 2318 } |
2319 } | 2319 } |
OLD | NEW |