OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 closureToClassMapper; | 5 library closureToClassMapper; |
6 | 6 |
7 import 'common.dart'; | 7 import 'common.dart'; |
8 import 'common/names.dart' show Identifiers; | 8 import 'common/names.dart' show Identifiers; |
9 import 'common/resolution.dart' show Parsing, Resolution; | 9 import 'common/resolution.dart' show Parsing, Resolution; |
10 import 'common/tasks.dart' show CompilerTask; | 10 import 'common/tasks.dart' show CompilerTask; |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 | 178 |
179 ClosureClassElement( | 179 ClosureClassElement( |
180 this.node, String name, Compiler compiler, LocalFunctionElement closure) | 180 this.node, String name, Compiler compiler, LocalFunctionElement closure) |
181 : this.methodElement = closure, | 181 : this.methodElement = closure, |
182 super( | 182 super( |
183 name, | 183 name, |
184 closure.compilationUnit, | 184 closure.compilationUnit, |
185 // By assigning a fresh class-id we make sure that the hashcode | 185 // By assigning a fresh class-id we make sure that the hashcode |
186 // is unique, but also emit closure classes after all other | 186 // is unique, but also emit closure classes after all other |
187 // classes (since the emitter sorts classes by their id). | 187 // classes (since the emitter sorts classes by their id). |
188 compiler.getNextFreeClassId(), | 188 compiler.getNextFreeId(), |
189 STATE_DONE) { | 189 STATE_DONE) { |
190 JavaScriptBackend backend = compiler.backend; | 190 JavaScriptBackend backend = compiler.backend; |
191 ClassElement superclass = methodElement.isInstanceMember | 191 ClassElement superclass = methodElement.isInstanceMember |
192 ? backend.helpers.boundClosureClass | 192 ? backend.helpers.boundClosureClass |
193 : backend.helpers.closureClass; | 193 : backend.helpers.closureClass; |
194 superclass.ensureResolved(compiler.resolution); | 194 superclass.ensureResolved(compiler.resolution); |
195 supertype = superclass.thisType; | 195 supertype = superclass.thisType; |
196 interfaces = const Link<DartType>(); | 196 interfaces = const Link<DartType>(); |
197 thisType = rawType = new InterfaceType(this); | 197 thisType = rawType = new InterfaceType(this); |
198 allSupertypesAndSelf = | 198 allSupertypesAndSelf = |
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1138 /// | 1138 /// |
1139 /// Move the below classes to a JS model eventually. | 1139 /// Move the below classes to a JS model eventually. |
1140 /// | 1140 /// |
1141 abstract class JSEntity implements Entity { | 1141 abstract class JSEntity implements Entity { |
1142 Entity get declaredEntity; | 1142 Entity get declaredEntity; |
1143 } | 1143 } |
1144 | 1144 |
1145 abstract class PrivatelyNamedJSEntity implements JSEntity { | 1145 abstract class PrivatelyNamedJSEntity implements JSEntity { |
1146 Entity get rootOfScope; | 1146 Entity get rootOfScope; |
1147 } | 1147 } |
OLD | NEW |