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 | 8 import 'common/names.dart' show |
9 Identifiers; | 9 Identifiers; |
10 import 'common/resolution.dart' show | 10 import 'common/resolution.dart' show |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 : this.methodElement = closure, | 189 : this.methodElement = closure, |
190 super(name, | 190 super(name, |
191 closure.compilationUnit, | 191 closure.compilationUnit, |
192 // By assigning a fresh class-id we make sure that the hashcode | 192 // By assigning a fresh class-id we make sure that the hashcode |
193 // is unique, but also emit closure classes after all other | 193 // is unique, but also emit closure classes after all other |
194 // classes (since the emitter sorts classes by their id). | 194 // classes (since the emitter sorts classes by their id). |
195 compiler.getNextFreeClassId(), | 195 compiler.getNextFreeClassId(), |
196 STATE_DONE) { | 196 STATE_DONE) { |
197 JavaScriptBackend backend = compiler.backend; | 197 JavaScriptBackend backend = compiler.backend; |
198 ClassElement superclass = methodElement.isInstanceMember | 198 ClassElement superclass = methodElement.isInstanceMember |
199 ? backend.boundClosureClass | 199 ? backend.helpers.boundClosureClass |
200 : backend.closureClass; | 200 : backend.helpers.closureClass; |
201 superclass.ensureResolved(compiler.resolution); | 201 superclass.ensureResolved(compiler.resolution); |
202 supertype = superclass.thisType; | 202 supertype = superclass.thisType; |
203 interfaces = const Link<DartType>(); | 203 interfaces = const Link<DartType>(); |
204 thisType = rawType = new InterfaceType(this); | 204 thisType = rawType = new InterfaceType(this); |
205 allSupertypesAndSelf = | 205 allSupertypesAndSelf = |
206 superclass.allSupertypesAndSelf.extendClass(thisType); | 206 superclass.allSupertypesAndSelf.extendClass(thisType); |
207 callType = methodElement.type; | 207 callType = methodElement.type; |
208 } | 208 } |
209 | 209 |
210 Iterable<ClosureFieldElement> get closureFields => _closureFields; | 210 Iterable<ClosureFieldElement> get closureFields => _closureFields; |
(...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1127 | 1127 |
1128 String get name => typeVariable.name; | 1128 String get name => typeVariable.name; |
1129 | 1129 |
1130 int get hashCode => typeVariable.hashCode; | 1130 int get hashCode => typeVariable.hashCode; |
1131 | 1131 |
1132 bool operator ==(other) { | 1132 bool operator ==(other) { |
1133 if (other is! TypeVariableLocal) return false; | 1133 if (other is! TypeVariableLocal) return false; |
1134 return typeVariable == other.typeVariable; | 1134 return typeVariable == other.typeVariable; |
1135 } | 1135 } |
1136 } | 1136 } |
OLD | NEW |