| 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/src/cancelable_future.dart'; | 10 import 'package:analyzer/src/cancelable_future.dart'; |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 } | 413 } |
| 414 | 414 |
| 415 set test_incrementalAnalysisCache(IncrementalAnalysisCache value) { | 415 set test_incrementalAnalysisCache(IncrementalAnalysisCache value) { |
| 416 _incrementalAnalysisCache = value; | 416 _incrementalAnalysisCache = value; |
| 417 } | 417 } |
| 418 | 418 |
| 419 List<Source> get test_priorityOrder => _priorityOrder; | 419 List<Source> get test_priorityOrder => _priorityOrder; |
| 420 | 420 |
| 421 @override | 421 @override |
| 422 TypeProvider get typeProvider { | 422 TypeProvider get typeProvider { |
| 423 // Make sure a task didn't accidentally try to call back into the context |
| 424 // to retrieve the type provider. |
| 425 assert(!driver.isTaskRunning); |
| 426 |
| 423 if (_typeProvider != null) { | 427 if (_typeProvider != null) { |
| 424 return _typeProvider; | 428 return _typeProvider; |
| 425 } | 429 } |
| 426 Source coreSource = sourceFactory.forUri(DartSdk.DART_CORE); | 430 Source coreSource = sourceFactory.forUri(DartSdk.DART_CORE); |
| 427 if (coreSource == null) { | 431 if (coreSource == null) { |
| 428 throw new AnalysisException("Could not create a source for dart:core"); | 432 throw new AnalysisException("Could not create a source for dart:core"); |
| 429 } | 433 } |
| 430 LibraryElement coreElement = computeLibraryElement(coreSource); | 434 LibraryElement coreElement = computeLibraryElement(coreSource); |
| 431 if (coreElement == null) { | 435 if (coreElement == null) { |
| 432 throw new AnalysisException("Could not create an element for dart:core"); | 436 throw new AnalysisException("Could not create an element for dart:core"); |
| (...skipping 1601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2034 PendingFuture pendingFuture = | 2038 PendingFuture pendingFuture = |
| 2035 new PendingFuture<T>(_context, target, computeValue); | 2039 new PendingFuture<T>(_context, target, computeValue); |
| 2036 if (!pendingFuture.evaluate(entry)) { | 2040 if (!pendingFuture.evaluate(entry)) { |
| 2037 _context._pendingFutureTargets | 2041 _context._pendingFutureTargets |
| 2038 .putIfAbsent(target, () => <PendingFuture>[]) | 2042 .putIfAbsent(target, () => <PendingFuture>[]) |
| 2039 .add(pendingFuture); | 2043 .add(pendingFuture); |
| 2040 } | 2044 } |
| 2041 return pendingFuture.future; | 2045 return pendingFuture.future; |
| 2042 } | 2046 } |
| 2043 } | 2047 } |
| OLD | NEW |