| 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.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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |