| 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/names.dart' show Identifiers; | 7 import 'common/names.dart' show Identifiers; |
| 8 import 'common/resolution.dart' show ParsingContext, Resolution; | 8 import 'common/resolution.dart' show ParsingContext, Resolution; |
| 9 import 'common/tasks.dart' show CompilerTask; | 9 import 'common/tasks.dart' show CompilerTask; |
| 10 import 'common.dart'; | 10 import 'common.dart'; |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 : this.methodElement = closure, | 265 : this.methodElement = closure, |
| 266 super( | 266 super( |
| 267 name, | 267 name, |
| 268 closure.compilationUnit, | 268 closure.compilationUnit, |
| 269 // By assigning a fresh class-id we make sure that the hashcode | 269 // By assigning a fresh class-id we make sure that the hashcode |
| 270 // is unique, but also emit closure classes after all other | 270 // is unique, but also emit closure classes after all other |
| 271 // classes (since the emitter sorts classes by their id). | 271 // classes (since the emitter sorts classes by their id). |
| 272 compiler.idGenerator.getNextFreeId(), | 272 compiler.idGenerator.getNextFreeId(), |
| 273 STATE_DONE) { | 273 STATE_DONE) { |
| 274 ClassElement superclass = methodElement.isInstanceMember | 274 ClassElement superclass = methodElement.isInstanceMember |
| 275 ? compiler.commonElements.boundClosureClass | 275 ? compiler.resolution.commonElements.boundClosureClass |
| 276 : compiler.commonElements.closureClass; | 276 : compiler.resolution.commonElements.closureClass; |
| 277 superclass.ensureResolved(compiler.resolution); | 277 superclass.ensureResolved(compiler.resolution); |
| 278 supertype = superclass.thisType; | 278 supertype = superclass.thisType; |
| 279 interfaces = const Link<ResolutionDartType>(); | 279 interfaces = const Link<ResolutionDartType>(); |
| 280 thisType = rawType = new ResolutionInterfaceType(this); | 280 thisType = rawType = new ResolutionInterfaceType(this); |
| 281 allSupertypesAndSelf = | 281 allSupertypesAndSelf = |
| 282 superclass.allSupertypesAndSelf.extendClass(thisType); | 282 superclass.allSupertypesAndSelf.extendClass(thisType); |
| 283 callType = methodElement.type; | 283 callType = methodElement.type; |
| 284 } | 284 } |
| 285 | 285 |
| 286 Iterable<ClosureFieldElement> get closureFields => _closureFields; | 286 Iterable<ClosureFieldElement> get closureFields => _closureFields; |
| (...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1290 /// | 1290 /// |
| 1291 /// Move the below classes to a JS model eventually. | 1291 /// Move the below classes to a JS model eventually. |
| 1292 /// | 1292 /// |
| 1293 abstract class JSEntity implements MemberEntity { | 1293 abstract class JSEntity implements MemberEntity { |
| 1294 Local get declaredEntity; | 1294 Local get declaredEntity; |
| 1295 } | 1295 } |
| 1296 | 1296 |
| 1297 abstract class PrivatelyNamedJSEntity implements JSEntity { | 1297 abstract class PrivatelyNamedJSEntity implements JSEntity { |
| 1298 Entity get rootOfScope; | 1298 Entity get rootOfScope; |
| 1299 } | 1299 } |
| OLD | NEW |