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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 assert(invariant(resolvedAst.element, closureClassMap != null, | 45 assert(invariant(resolvedAst.element, closureClassMap != null, |
46 message: "No ClosureClassMap computed for ${element}.")); | 46 message: "No ClosureClassMap computed for ${element}.")); |
47 return closureClassMap; | 47 return closureClassMap; |
48 }); | 48 }); |
49 } | 49 } |
50 | 50 |
51 /// Create [ClosureClassMap]s for all live members. | 51 /// Create [ClosureClassMap]s for all live members. |
52 void createClosureClasses() { | 52 void createClosureClasses() { |
53 compiler.enqueuer.resolution.processedElements | 53 compiler.enqueuer.resolution.processedElements |
54 .forEach((AstElement element) { | 54 .forEach((AstElement element) { |
| 55 // TODO(johnniwinther): Typedefs should never be in processedElements. |
| 56 if (element.isTypedef) return; |
55 ResolvedAst resolvedAst = element.resolvedAst; | 57 ResolvedAst resolvedAst = element.resolvedAst; |
56 if (element.isAbstract) return; | 58 if (element.isAbstract) return; |
57 if (element.isField && | 59 if (element.isField && |
58 !element.isInstanceMember && | 60 !element.isInstanceMember && |
59 resolvedAst.body == null) { | 61 resolvedAst.body == null) { |
60 // Skip top-level/static fields without an initializer. | 62 // Skip top-level/static fields without an initializer. |
61 return; | 63 return; |
62 } | 64 } |
63 computeClosureToClassMapping(resolvedAst); | 65 computeClosureToClassMapping(resolvedAst); |
64 }); | 66 }); |
(...skipping 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1208 /// | 1210 /// |
1209 /// Move the below classes to a JS model eventually. | 1211 /// Move the below classes to a JS model eventually. |
1210 /// | 1212 /// |
1211 abstract class JSEntity implements Entity { | 1213 abstract class JSEntity implements Entity { |
1212 Entity get declaredEntity; | 1214 Entity get declaredEntity; |
1213 } | 1215 } |
1214 | 1216 |
1215 abstract class PrivatelyNamedJSEntity implements JSEntity { | 1217 abstract class PrivatelyNamedJSEntity implements JSEntity { |
1216 Entity get rootOfScope; | 1218 Entity get rootOfScope; |
1217 } | 1219 } |
OLD | NEW |