Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1727)

Side by Side Diff: pkg/analyzer/lib/src/task/dart.dart

Issue 2044383003: Issue 26639. Set source for mock 'dart:async' library. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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.task.dart; 5 library analyzer.src.task.dart;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/token.dart'; 10 import 'package:analyzer/dart/ast/token.dart';
(...skipping 1786 matching lines...) Expand 10 before | Expand all | Expand 10 after
1797 : super(context, target); 1797 : super(context, target);
1798 1798
1799 @override 1799 @override
1800 TaskDescriptor get descriptor => DESCRIPTOR; 1800 TaskDescriptor get descriptor => DESCRIPTOR;
1801 1801
1802 @override 1802 @override
1803 void internalPerform() { 1803 void internalPerform() {
1804 LibraryElement coreLibrary = getRequiredInput(CORE_INPUT); 1804 LibraryElement coreLibrary = getRequiredInput(CORE_INPUT);
1805 LibraryElement asyncLibrary = getOptionalInput(ASYNC_INPUT); 1805 LibraryElement asyncLibrary = getOptionalInput(ASYNC_INPUT);
1806 if (asyncLibrary == null) { 1806 if (asyncLibrary == null) {
1807 asyncLibrary = 1807 Source asyncSource = context.sourceFactory.forUri(DartSdk.DART_ASYNC);
1808 (context as AnalysisContextImpl).createMockAsyncLib(coreLibrary); 1808 asyncLibrary = (context as AnalysisContextImpl)
1809 .createMockAsyncLib(coreLibrary, asyncSource);
1809 } 1810 }
1810 Namespace coreNamespace = coreLibrary.publicNamespace; 1811 Namespace coreNamespace = coreLibrary.publicNamespace;
1811 Namespace asyncNamespace = asyncLibrary.publicNamespace; 1812 Namespace asyncNamespace = asyncLibrary.publicNamespace;
1812 // 1813 //
1813 // Record outputs. 1814 // Record outputs.
1814 // 1815 //
1815 if (!context.analysisOptions.enableAsync) { 1816 if (!context.analysisOptions.enableAsync) {
1816 AnalysisContextImpl contextImpl = context; 1817 AnalysisContextImpl contextImpl = context;
1817 asyncLibrary = contextImpl.createMockAsyncLib(coreLibrary); 1818 Source asyncSource = context.sourceFactory.forUri(DartSdk.DART_ASYNC);
1819 asyncLibrary = contextImpl.createMockAsyncLib(coreLibrary, asyncSource);
1818 asyncNamespace = asyncLibrary.publicNamespace; 1820 asyncNamespace = asyncLibrary.publicNamespace;
1819 } 1821 }
1820 TypeProvider typeProvider = 1822 TypeProvider typeProvider =
1821 new TypeProviderImpl.forNamespaces(coreNamespace, asyncNamespace); 1823 new TypeProviderImpl.forNamespaces(coreNamespace, asyncNamespace);
1822 (context as InternalAnalysisContext).typeProvider = typeProvider; 1824 (context as InternalAnalysisContext).typeProvider = typeProvider;
1823 outputs[TYPE_PROVIDER] = typeProvider; 1825 outputs[TYPE_PROVIDER] = typeProvider;
1824 } 1826 }
1825 1827
1826 static Map<String, TaskInput> buildInputs(AnalysisTarget target) { 1828 static Map<String, TaskInput> buildInputs(AnalysisTarget target) {
1827 AnalysisContextTarget contextTarget = target; 1829 AnalysisContextTarget contextTarget = target;
(...skipping 4137 matching lines...) Expand 10 before | Expand all | Expand 10 after
5965 5967
5966 @override 5968 @override
5967 bool moveNext() { 5969 bool moveNext() {
5968 if (_newSources.isEmpty) { 5970 if (_newSources.isEmpty) {
5969 return false; 5971 return false;
5970 } 5972 }
5971 currentTarget = _newSources.removeLast(); 5973 currentTarget = _newSources.removeLast();
5972 return true; 5974 return true;
5973 } 5975 }
5974 } 5976 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/context/context.dart ('k') | pkg/analyzer/test/generated/resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698