| 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 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 718 } | 718 } |
| 719 | 719 |
| 720 InterfaceType futureType = _classElement('Future', ['T']).type; | 720 InterfaceType futureType = _classElement('Future', ['T']).type; |
| 721 InterfaceType streamType = _classElement('Stream', ['T']).type; | 721 InterfaceType streamType = _classElement('Stream', ['T']).type; |
| 722 CompilationUnitElementImpl asyncUnit = | 722 CompilationUnitElementImpl asyncUnit = |
| 723 new CompilationUnitElementImpl("mock_async.dart"); | 723 new CompilationUnitElementImpl("mock_async.dart"); |
| 724 asyncUnit.types = <ClassElement>[futureType.element, streamType.element]; | 724 asyncUnit.types = <ClassElement>[futureType.element, streamType.element]; |
| 725 LibraryElementImpl mockLib = new LibraryElementImpl.forNode( | 725 LibraryElementImpl mockLib = new LibraryElementImpl.forNode( |
| 726 this, AstFactory.libraryIdentifier2(["dart.async"])); | 726 this, AstFactory.libraryIdentifier2(["dart.async"])); |
| 727 mockLib.definingCompilationUnit = asyncUnit; | 727 mockLib.definingCompilationUnit = asyncUnit; |
| 728 mockLib.publicNamespace = new PublicNamespaceBuilder().build(mockLib); | 728 mockLib.publicNamespace = |
| 729 new NamespaceBuilder().createPublicNamespaceForLibrary(mockLib); |
| 729 return mockLib; | 730 return mockLib; |
| 730 } | 731 } |
| 731 | 732 |
| 732 @override | 733 @override |
| 733 void dispose() { | 734 void dispose() { |
| 734 _disposed = true; | 735 _disposed = true; |
| 735 for (List<PendingFuture> pendingFutures in _pendingFutureTargets.values) { | 736 for (List<PendingFuture> pendingFutures in _pendingFutureTargets.values) { |
| 736 for (PendingFuture pendingFuture in pendingFutures) { | 737 for (PendingFuture pendingFuture in pendingFutures) { |
| 737 pendingFuture.forciblyComplete(); | 738 pendingFuture.forciblyComplete(); |
| 738 } | 739 } |
| (...skipping 1388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2127 } | 2128 } |
| 2128 DartSdk sdk = factory.dartSdk; | 2129 DartSdk sdk = factory.dartSdk; |
| 2129 if (sdk == null) { | 2130 if (sdk == null) { |
| 2130 throw new IllegalArgumentException( | 2131 throw new IllegalArgumentException( |
| 2131 "The source factory for an SDK analysis context must have a DartUriRes
olver"); | 2132 "The source factory for an SDK analysis context must have a DartUriRes
olver"); |
| 2132 } | 2133 } |
| 2133 return new AnalysisCache( | 2134 return new AnalysisCache( |
| 2134 <CachePartition>[AnalysisEngine.instance.partitionManager.forSdk(sdk)]); | 2135 <CachePartition>[AnalysisEngine.instance.partitionManager.forSdk(sdk)]); |
| 2135 } | 2136 } |
| 2136 } | 2137 } |
| OLD | NEW |