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 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
459 target, iterator.value, false, hintsEnabled, lintsEnabled, sources); | 459 target, iterator.value, false, hintsEnabled, lintsEnabled, sources); |
460 } | 460 } |
461 } | 461 } |
462 return new List<Source>.from(sources); | 462 return new List<Source>.from(sources); |
463 } | 463 } |
464 | 464 |
465 List<Source> get test_priorityOrder => _priorityOrder; | 465 List<Source> get test_priorityOrder => _priorityOrder; |
466 | 466 |
467 @override | 467 @override |
468 TypeProvider get typeProvider { | 468 TypeProvider get typeProvider { |
469 // Make sure a task didn't accidentally try to call back into the context | |
470 // to retrieve the type provider. | |
471 assert(!driver.isTaskRunning); | |
Brian Wilkerson
2016/06/01 22:23:28
Instead of removing this completely, would it work
Paul Berry
2016/06/01 22:25:55
+1 to this. The reason we added this check in the
scheglov
2016/06/02 00:20:40
That's a great idea.
Thank you!
Done.
| |
472 | |
473 if (_typeProvider != null) { | 469 if (_typeProvider != null) { |
474 return _typeProvider; | 470 return _typeProvider; |
475 } | 471 } |
476 Source coreSource = sourceFactory.forUri(DartSdk.DART_CORE); | 472 Source coreSource = sourceFactory.forUri(DartSdk.DART_CORE); |
477 if (coreSource == null) { | 473 if (coreSource == null) { |
478 throw new AnalysisException("Could not create a source for dart:core"); | 474 throw new AnalysisException("Could not create a source for dart:core"); |
479 } | 475 } |
480 LibraryElement coreElement = computeLibraryElement(coreSource); | 476 LibraryElement coreElement = computeLibraryElement(coreSource); |
481 if (coreElement == null) { | 477 if (coreElement == null) { |
482 throw new AnalysisException("Could not create an element for dart:core"); | 478 throw new AnalysisException("Could not create an element for dart:core"); |
(...skipping 1730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2213 } | 2209 } |
2214 DartSdk sdk = factory.dartSdk; | 2210 DartSdk sdk = factory.dartSdk; |
2215 if (sdk == null) { | 2211 if (sdk == null) { |
2216 throw new IllegalArgumentException( | 2212 throw new IllegalArgumentException( |
2217 "The source factory for an SDK analysis context must have a DartUriRes olver"); | 2213 "The source factory for an SDK analysis context must have a DartUriRes olver"); |
2218 } | 2214 } |
2219 return new AnalysisCache( | 2215 return new AnalysisCache( |
2220 <CachePartition>[AnalysisEngine.instance.partitionManager.forSdk(sdk)]); | 2216 <CachePartition>[AnalysisEngine.instance.partitionManager.forSdk(sdk)]); |
2221 } | 2217 } |
2222 } | 2218 } |
OLD | NEW |