| 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 analyzer.src.context.context; | 5 library analyzer.src.context.context; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 | 9 |
| 10 import 'package:analyzer/instrumentation/instrumentation.dart'; | 10 import 'package:analyzer/instrumentation/instrumentation.dart'; |
| (...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 814 return SourceKind.HTML; | 814 return SourceKind.HTML; |
| 815 } | 815 } |
| 816 return SourceKind.UNKNOWN; | 816 return SourceKind.UNKNOWN; |
| 817 } | 817 } |
| 818 | 818 |
| 819 @override | 819 @override |
| 820 List<Source> getLibrariesContaining(Source source) { | 820 List<Source> getLibrariesContaining(Source source) { |
| 821 SourceKind kind = getKindOf(source); | 821 SourceKind kind = getKindOf(source); |
| 822 if (kind == SourceKind.LIBRARY) { | 822 if (kind == SourceKind.LIBRARY) { |
| 823 return <Source>[source]; | 823 return <Source>[source]; |
| 824 } else if (kind == SourceKind.PART) { | |
| 825 return dartWorkManager.getLibrariesContainingPart(source); | |
| 826 } | 824 } |
| 827 return Source.EMPTY_ARRAY; | 825 return dartWorkManager.getLibrariesContainingPart(source); |
| 828 } | 826 } |
| 829 | 827 |
| 830 @override | 828 @override |
| 831 List<Source> getLibrariesDependingOn(Source librarySource) { | 829 List<Source> getLibrariesDependingOn(Source librarySource) { |
| 832 List<Source> dependentLibraries = <Source>[]; | 830 List<Source> dependentLibraries = <Source>[]; |
| 833 for (Source source in _cache.sources) { | 831 for (Source source in _cache.sources) { |
| 834 CacheEntry entry = _cache.get(source); | 832 CacheEntry entry = _cache.get(source); |
| 835 if (entry.getValue(SOURCE_KIND) == SourceKind.LIBRARY) { | 833 if (entry.getValue(SOURCE_KIND) == SourceKind.LIBRARY) { |
| 836 if (_contains(entry.getValue(EXPORTED_LIBRARIES), librarySource)) { | 834 if (_contains(entry.getValue(EXPORTED_LIBRARIES), librarySource)) { |
| 837 dependentLibraries.add(source); | 835 dependentLibraries.add(source); |
| (...skipping 1184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2022 PendingFuture pendingFuture = | 2020 PendingFuture pendingFuture = |
| 2023 new PendingFuture<T>(_context, target, computeValue); | 2021 new PendingFuture<T>(_context, target, computeValue); |
| 2024 if (!pendingFuture.evaluate(entry)) { | 2022 if (!pendingFuture.evaluate(entry)) { |
| 2025 _context._pendingFutureTargets | 2023 _context._pendingFutureTargets |
| 2026 .putIfAbsent(target, () => <PendingFuture>[]) | 2024 .putIfAbsent(target, () => <PendingFuture>[]) |
| 2027 .add(pendingFuture); | 2025 .add(pendingFuture); |
| 2028 } | 2026 } |
| 2029 return pendingFuture.future; | 2027 return pendingFuture.future; |
| 2030 } | 2028 } |
| 2031 } | 2029 } |
| OLD | NEW |