| 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 2159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2170 KernelClosureClass constructClosureClass( | 2170 KernelClosureClass constructClosureClass( |
| 2171 MemberEntity member, | 2171 MemberEntity member, |
| 2172 ir.FunctionNode node, | 2172 ir.FunctionNode node, |
| 2173 JLibrary enclosingLibrary, | 2173 JLibrary enclosingLibrary, |
| 2174 KernelScopeInfo info, | 2174 KernelScopeInfo info, |
| 2175 ir.Location location, | 2175 ir.Location location, |
| 2176 KernelToLocalsMap localsMap, | 2176 KernelToLocalsMap localsMap, |
| 2177 InterfaceType supertype) { | 2177 InterfaceType supertype) { |
| 2178 String name = _computeClosureName(node); | 2178 String name = _computeClosureName(node); |
| 2179 JClass classEntity = | 2179 JClass classEntity = |
| 2180 new JClosureClass(localsMap, enclosingLibrary, _classEnvs.length, name); | 2180 new JClosureClass(enclosingLibrary, _classEnvs.length, name); |
| 2181 _classList.add(classEntity); | 2181 _classList.add(classEntity); |
| 2182 Map<String, MemberEntity> memberMap = <String, MemberEntity>{}; | 2182 Map<String, MemberEntity> memberMap = <String, MemberEntity>{}; |
| 2183 _classEnvs.add(new ClosureClassEnv(memberMap)); | 2183 _classEnvs.add(new ClosureClassEnv(memberMap)); |
| 2184 | 2184 |
| 2185 // Create a classData and set up the interfaces and subclass | 2185 // Create a classData and set up the interfaces and subclass |
| 2186 // relationships that _ensureSupertypes and _ensureThisAndRawType are doing | 2186 // relationships that _ensureSupertypes and _ensureThisAndRawType are doing |
| 2187 var closureData = new ClassData( | 2187 var closureData = new ClassData( |
| 2188 null, | 2188 null, |
| 2189 new ClosureClassDefinition( | 2189 new ClosureClassDefinition( |
| 2190 classEntity, computeSourceSpanFromTreeNode(node))); | 2190 classEntity, computeSourceSpanFromTreeNode(node))); |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2321 /// | 2321 /// |
| 2322 /// These names are not used in generated code, just as element name. | 2322 /// These names are not used in generated code, just as element name. |
| 2323 String _getClosureVariableName(String name, int id) { | 2323 String _getClosureVariableName(String name, int id) { |
| 2324 return "_captured_${name}_$id"; | 2324 return "_captured_${name}_$id"; |
| 2325 } | 2325 } |
| 2326 | 2326 |
| 2327 String getDeferredUri(ir.LibraryDependency node) { | 2327 String getDeferredUri(ir.LibraryDependency node) { |
| 2328 throw new UnimplementedError('JsKernelToElementMap.getDeferredUri'); | 2328 throw new UnimplementedError('JsKernelToElementMap.getDeferredUri'); |
| 2329 } | 2329 } |
| 2330 } | 2330 } |
| OLD | NEW |