| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 ClosureClassMap closureClassMap = _closureMappingCache[element]; | 46 ClosureClassMap closureClassMap = _closureMappingCache[element]; |
| 47 assert(invariant(resolvedAst.element, closureClassMap != null, | 47 assert(invariant(resolvedAst.element, closureClassMap != null, |
| 48 message: "No ClosureClassMap computed for ${element}.")); | 48 message: "No ClosureClassMap computed for ${element}.")); |
| 49 return closureClassMap; | 49 return closureClassMap; |
| 50 }); | 50 }); |
| 51 } | 51 } |
| 52 | 52 |
| 53 /// Create [ClosureClassMap]s for all live members. | 53 /// Create [ClosureClassMap]s for all live members. |
| 54 void createClosureClasses(ClosedWorldRefiner closedWorldRefiner) { | 54 void createClosureClasses(ClosedWorldRefiner closedWorldRefiner) { |
| 55 compiler.enqueuer.resolution.processedEntities | 55 compiler.enqueuer.resolution.processedEntities |
| 56 .forEach((AstElement element) { | 56 .forEach((MemberElement element) { |
| 57 // TODO(johnniwinther): Typedefs should never be in processedElements. | |
| 58 if (element.isTypedef) return; | |
| 59 ResolvedAst resolvedAst = element.resolvedAst; | 57 ResolvedAst resolvedAst = element.resolvedAst; |
| 60 if (element.isAbstract) return; | 58 if (element.isAbstract) return; |
| 61 if (element.isField && | 59 if (element.isField && |
| 62 !element.isInstanceMember && | 60 !element.isInstanceMember && |
| 63 resolvedAst.body == null) { | 61 resolvedAst.body == null) { |
| 64 // Skip top-level/static fields without an initializer. | 62 // Skip top-level/static fields without an initializer. |
| 65 return; | 63 return; |
| 66 } | 64 } |
| 67 computeClosureToClassMapping(resolvedAst, closedWorldRefiner); | 65 computeClosureToClassMapping(resolvedAst, closedWorldRefiner); |
| 68 }); | 66 }); |
| (...skipping 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1224 /// | 1222 /// |
| 1225 /// Move the below classes to a JS model eventually. | 1223 /// Move the below classes to a JS model eventually. |
| 1226 /// | 1224 /// |
| 1227 abstract class JSEntity implements Entity { | 1225 abstract class JSEntity implements Entity { |
| 1228 Entity get declaredEntity; | 1226 Entity get declaredEntity; |
| 1229 } | 1227 } |
| 1230 | 1228 |
| 1231 abstract class PrivatelyNamedJSEntity implements JSEntity { | 1229 abstract class PrivatelyNamedJSEntity implements JSEntity { |
| 1232 Entity get rootOfScope; | 1230 Entity get rootOfScope; |
| 1233 } | 1231 } |
| OLD | NEW |