Chromium Code Reviews| Index: pkg/dev_compiler/lib/src/compiler/compiler.dart |
| diff --git a/pkg/dev_compiler/lib/src/compiler/compiler.dart b/pkg/dev_compiler/lib/src/compiler/compiler.dart |
| index 5a84af33c2194ffdf3b1adf86d543e82e5d8f9aa..75337de7bc9ec6e8929f1708792e258dd2ca6eb1 100644 |
| --- a/pkg/dev_compiler/lib/src/compiler/compiler.dart |
| +++ b/pkg/dev_compiler/lib/src/compiler/compiler.dart |
| @@ -5,14 +5,16 @@ |
| import 'dart:collection' show HashSet, Queue; |
| import 'dart:convert' show BASE64, JSON, UTF8; |
| import 'dart:io' show File; |
| -import 'package:analyzer/dart/element/element.dart' show LibraryElement; |
| + |
| import 'package:analyzer/analyzer.dart' |
| show AnalysisError, CompilationUnit, ErrorSeverity; |
| +import 'package:analyzer/dart/element/element.dart' show LibraryElement; |
| import 'package:analyzer/file_system/file_system.dart' show ResourceProvider; |
| import 'package:analyzer/file_system/physical_file_system.dart' |
| show PhysicalResourceProvider; |
| import 'package:analyzer/src/context/builder.dart' show ContextBuilder; |
| import 'package:analyzer/src/context/context.dart' show AnalysisContextImpl; |
| +import 'package:analyzer/src/error/codes.dart' show StaticTypeWarningCode; |
| import 'package:analyzer/src/generated/engine.dart' |
| show AnalysisContext, AnalysisEngine; |
| import 'package:analyzer/src/generated/sdk.dart' show DartSdkManager; |
| @@ -22,7 +24,6 @@ import 'package:analyzer/src/generated/source_io.dart' |
| show Source, SourceKind, UriResolver; |
| import 'package:analyzer/src/summary/package_bundle_reader.dart' |
| show InSummarySource, InputPackagesResultProvider, SummaryDataStore; |
| -import 'package:analyzer/src/error/codes.dart' show StaticTypeWarningCode; |
| import 'package:args/args.dart' show ArgParser, ArgResults; |
| import 'package:args/src/usage_exception.dart' show UsageException; |
| import 'package:func/func.dart' show Func1; |
| @@ -86,6 +87,10 @@ class ModuleCompiler { |
| // Read the summaries. |
| var summaryData = |
| new SummaryDataStore(options.summaryPaths, recordDependencyInfo: true); |
| + var sdkSummaryBundle = sdk.getLinkedBundle(); |
|
vsm
2017/01/24 16:41:41
This logic really needs to be folded in with the r
scheglov
2017/01/24 17:04:33
It is possible.
But it does not seem very useful.
vsm
2017/01/24 17:10:35
The current state means bugs like this need to be
scheglov
2017/01/24 17:13:07
Exactly.
This code duplication should be solved fo
|
| + if (sdkSummaryBundle != null) { |
| + summaryData.addBundle(null, sdkSummaryBundle); |
| + } |
| var srcFactory = createSourceFactory(options, |
| sdkResolver: sdkResolver, |
| @@ -97,9 +102,10 @@ class ModuleCompiler { |
| AnalysisEngine.instance.createAnalysisContext() as AnalysisContextImpl; |
| context.analysisOptions = analysisOptions; |
| context.sourceFactory = srcFactory; |
| - context.typeProvider = sdkResolver.dartSdk.context.typeProvider; |
| - context.resultProvider = |
| - new InputPackagesResultProvider(context, summaryData); |
| + if (sdkSummaryBundle != null) { |
| + context.resultProvider = |
| + new InputPackagesResultProvider(context, summaryData); |
| + } |
| options.declaredVariables.forEach(context.declaredVariables.define); |
| context.declaredVariables.define('dart.isVM', 'false'); |