| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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.class_set; | 5 library dart2js.world.class_set; |
| 6 | 6 |
| 7 import 'dart:collection' show IterableBase; | 7 import 'dart:collection' show IterableBase; |
| 8 | 8 |
| 9 import '../elements/elements.dart' show ClassElement; | 9 import '../elements/elements.dart' show ClassElement; |
| 10 import '../util/enumset.dart' show EnumSet; | 10 import '../util/enumset.dart' show EnumSet; |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 if (_subtypes != null) { | 454 if (_subtypes != null) { |
| 455 for (ClassHierarchyNode subtypeNode in _subtypes) { | 455 for (ClassHierarchyNode subtypeNode in _subtypes) { |
| 456 if (subtypeNode.isInstantiated) { | 456 if (subtypeNode.isInstantiated) { |
| 457 return false; | 457 return false; |
| 458 } | 458 } |
| 459 } | 459 } |
| 460 } | 460 } |
| 461 return true; | 461 return true; |
| 462 } | 462 } |
| 463 | 463 |
| 464 Iterable<ClassHierarchyNode> get subtypeNodes { |
| 465 return _subtypes ?? const <ClassHierarchyNode>[]; |
| 466 } |
| 467 |
| 464 /// Returns an [Iterable] of the subclasses of [cls] possibly including [cls]. | 468 /// Returns an [Iterable] of the subclasses of [cls] possibly including [cls]. |
| 465 /// | 469 /// |
| 466 /// Subclasses are included if their instantiation properties intersect with | 470 /// Subclasses are included if their instantiation properties intersect with |
| 467 /// their corresponding [Instantiation] values in [mask]. If [strict] is | 471 /// their corresponding [Instantiation] values in [mask]. If [strict] is |
| 468 /// `true`, [cls] itself is _not_ returned. | 472 /// `true`, [cls] itself is _not_ returned. |
| 469 Iterable<ClassElement> subclassesByMask(EnumSet<Instantiation> mask, | 473 Iterable<ClassElement> subclassesByMask(EnumSet<Instantiation> mask, |
| 470 {bool strict: false}) { | 474 {bool strict: false}) { |
| 471 return node.subclassesByMask(mask, strict: strict); | 475 return node.subclassesByMask(mask, strict: strict); |
| 472 } | 476 } |
| 473 | 477 |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 850 STOP, | 854 STOP, |
| 851 | 855 |
| 852 /// Iteration skips the subclasses of the current class. | 856 /// Iteration skips the subclasses of the current class. |
| 853 SKIP_SUBCLASSES, | 857 SKIP_SUBCLASSES, |
| 854 } | 858 } |
| 855 | 859 |
| 856 /// Visiting function used for the `forEachX` functions of [ClassHierarchyNode] | 860 /// Visiting function used for the `forEachX` functions of [ClassHierarchyNode] |
| 857 /// and [ClassSet]. The return value controls the continued iteration. If `null` | 861 /// and [ClassSet]. The return value controls the continued iteration. If `null` |
| 858 /// is returned, iteration continues to the end. | 862 /// is returned, iteration continues to the end. |
| 859 typedef IterationStep ForEachFunction(ClassElement cls); | 863 typedef IterationStep ForEachFunction(ClassElement cls); |
| OLD | NEW |