| 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 dart2js.world; | 5 library dart2js.world; |
| 6 | 6 |
| 7 import 'closure.dart' show ClosureClassElement, SynthesizedCallMethodElementX; | 7 import 'closure.dart' show ClosureClassElement, SynthesizedCallMethodElementX; |
| 8 import 'common.dart'; | 8 import 'common.dart'; |
| 9 import 'constants/constant_system.dart'; | 9 import 'constants/constant_system.dart'; |
| 10 import 'common_elements.dart' show CommonElements; | 10 import 'common_elements.dart' show CommonElements; |
| (...skipping 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1164 mixinUses: mixinUses, | 1164 mixinUses: mixinUses, |
| 1165 typesImplementedBySubclasses: typesImplementedBySubclasses, | 1165 typesImplementedBySubclasses: typesImplementedBySubclasses, |
| 1166 classHierarchyNodes: classHierarchyNodes, | 1166 classHierarchyNodes: classHierarchyNodes, |
| 1167 classSets: classSets); | 1167 classSets: classSets); |
| 1168 | 1168 |
| 1169 bool _checkClass(ClassElement cls) => cls.isDeclaration; | 1169 bool _checkClass(ClassElement cls) => cls.isDeclaration; |
| 1170 | 1170 |
| 1171 bool _checkEntity(Element element) => element.isDeclaration; | 1171 bool _checkEntity(Element element) => element.isDeclaration; |
| 1172 | 1172 |
| 1173 bool _checkInvariants(ClassElement cls, {bool mustBeInstantiated: true}) { | 1173 bool _checkInvariants(ClassElement cls, {bool mustBeInstantiated: true}) { |
| 1174 return invariant(cls, cls.isDeclaration, | 1174 assert(cls.isDeclaration, failedAt(cls, '$cls must be the declaration.')); |
| 1175 message: '$cls must be the declaration.') && | 1175 assert(cls.isResolved, failedAt(cls, '$cls must be resolved.')); |
| 1176 invariant(cls, cls.isResolved, | 1176 |
| 1177 message: | 1177 // TODO(johnniwinther): Reinsert this or similar invariant. Currently |
| 1178 '$cls must be resolved.') /* && | 1178 // various call sites use uninstantiated classes for isSubtypeOf or |
| 1179 // TODO(johnniwinther): Reinsert this or similar invariant. Currently | 1179 // isSubclassOf. Some are valid, some are not. Work out better invariants |
| 1180 // various call sites use uninstantiated classes for isSubtypeOf or | 1180 // to catch the latter. |
| 1181 // isSubclassOf. Some are valid, some are not. Work out better invariants | 1181 // if (mustBeInstantiated) { |
| 1182 // to catch the latter. | 1182 // assert(isInstantiated(cls), failedAt(cls, '$cls is not instantiated.')); |
| 1183 (!mustBeInstantiated || | 1183 // } |
| 1184 invariant(cls, isInstantiated(cls), | 1184 return true; |
| 1185 message: '$cls is not instantiated.'))*/ | |
| 1186 ; | |
| 1187 } | 1185 } |
| 1188 | 1186 |
| 1189 OrderedTypeSet _getOrderedTypeSet(ClassElement cls) => | 1187 OrderedTypeSet _getOrderedTypeSet(ClassElement cls) => |
| 1190 cls.allSupertypesAndSelf; | 1188 cls.allSupertypesAndSelf; |
| 1191 | 1189 |
| 1192 int _getHierarchyDepth(ClassElement cls) => cls.hierarchyDepth; | 1190 int _getHierarchyDepth(ClassElement cls) => cls.hierarchyDepth; |
| 1193 | 1191 |
| 1194 ClassEntity _getSuperClass(ClassElement cls) => cls.superclass; | 1192 ClassEntity _getSuperClass(ClassElement cls) => cls.superclass; |
| 1195 | 1193 |
| 1196 Iterable<ClassEntity> _getInterfaces(ClassElement cls) sync* { | 1194 Iterable<ClassEntity> _getInterfaces(ClassElement cls) sync* { |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1361 @override | 1359 @override |
| 1362 void registerClosureClass(ClassElement cls) { | 1360 void registerClosureClass(ClassElement cls) { |
| 1363 throw new UnimplementedError('KernelClosedWorld.registerClosureClass'); | 1361 throw new UnimplementedError('KernelClosedWorld.registerClosureClass'); |
| 1364 } | 1362 } |
| 1365 | 1363 |
| 1366 @override | 1364 @override |
| 1367 bool hasElementIn(ClassEntity cls, Selector selector, Entity element) { | 1365 bool hasElementIn(ClassEntity cls, Selector selector, Entity element) { |
| 1368 throw new UnimplementedError('KernelClosedWorld.hasElementIn'); | 1366 throw new UnimplementedError('KernelClosedWorld.hasElementIn'); |
| 1369 } | 1367 } |
| 1370 } | 1368 } |
| OLD | NEW |