Chromium Code Reviews| 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/dart/ast/ast.dart'; | 10 import 'package:analyzer/dart/ast/ast.dart'; |
| (...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 803 dartWorkManager.addPriorityResult(target, RESOLVED_UNIT); | 803 dartWorkManager.addPriorityResult(target, RESOLVED_UNIT); |
| 804 } | 804 } |
| 805 return null; | 805 return null; |
| 806 } | 806 } |
| 807 | 807 |
| 808 @override | 808 @override |
| 809 bool exists(Source source) { | 809 bool exists(Source source) { |
| 810 if (source == null) { | 810 if (source == null) { |
| 811 return false; | 811 return false; |
| 812 } | 812 } |
| 813 if (_contentCache.getContents(source) != null) { | 813 bool overriddenExists = _contentCache.getExists(source); |
| 814 return true; | 814 if (overriddenExists != null) { |
|
Paul Berry
2017/01/04 18:28:57
Assuming you accept my proposal below, I think lin
| |
| 815 return overriddenExists; | |
| 815 } | 816 } |
| 816 return source.exists(); | 817 return source.exists(); |
| 817 } | 818 } |
| 818 | 819 |
| 819 @override | 820 @override |
| 820 CacheEntry getCacheEntry(AnalysisTarget target) { | 821 CacheEntry getCacheEntry(AnalysisTarget target) { |
| 821 CacheEntry entry = _cache.get(target); | 822 CacheEntry entry = _cache.get(target); |
| 822 if (entry == null) { | 823 if (entry == null) { |
| 823 entry = new CacheEntry(target); | 824 entry = new CacheEntry(target); |
| 824 ImplicitAnalysisEvent event = null; | 825 ImplicitAnalysisEvent event = null; |
| (...skipping 1437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2262 } | 2263 } |
| 2263 DartSdk sdk = factory.dartSdk; | 2264 DartSdk sdk = factory.dartSdk; |
| 2264 if (sdk == null) { | 2265 if (sdk == null) { |
| 2265 throw new ArgumentError( | 2266 throw new ArgumentError( |
| 2266 "The source factory for an SDK analysis context must have a DartUriRes olver"); | 2267 "The source factory for an SDK analysis context must have a DartUriRes olver"); |
| 2267 } | 2268 } |
| 2268 return new AnalysisCache( | 2269 return new AnalysisCache( |
| 2269 <CachePartition>[AnalysisEngine.instance.partitionManager.forSdk(sdk)]); | 2270 <CachePartition>[AnalysisEngine.instance.partitionManager.forSdk(sdk)]); |
| 2270 } | 2271 } |
| 2271 } | 2272 } |
| OLD | NEW |