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

Unified Diff: pkg/analyzer/lib/src/summary/summary_sdk.dart

Issue 1979183005: Pass the 'strongMode' flag into SdkSummaryResynthesizer. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/generated/sdk_io.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/summary_sdk.dart
diff --git a/pkg/analyzer/lib/src/summary/summary_sdk.dart b/pkg/analyzer/lib/src/summary/summary_sdk.dart
index be0501cd398062f1619c7f1a661834918e04026a..ec9c9889adec44f1e79a11247ab50ccc7d41b3ae 100644
--- a/pkg/analyzer/lib/src/summary/summary_sdk.dart
+++ b/pkg/analyzer/lib/src/summary/summary_sdk.dart
@@ -32,9 +32,9 @@ class SdkSummaryResultProvider implements SummaryResultProvider {
@override
SummaryResynthesizer resynthesizer;
- SdkSummaryResultProvider(this.context, this.bundle) {
+ SdkSummaryResultProvider(this.context, this.bundle, bool strongMode) {
resynthesizer = new SdkSummaryResynthesizer(
- context, typeProvider, context.sourceFactory, bundle);
+ context, typeProvider, context.sourceFactory, bundle, strongMode);
_buildCoreLibrary();
_buildAsyncLibrary();
resynthesizer.finalizeCoreAsyncLibraries();
@@ -163,10 +163,8 @@ class SdkSummaryResynthesizer extends SummaryResynthesizer {
final Map<String, LinkedLibrary> linkedSummaries = <String, LinkedLibrary>{};
SdkSummaryResynthesizer(AnalysisContext context, TypeProvider typeProvider,
- SourceFactory sourceFactory, this.bundle)
- : super(null, context, typeProvider, sourceFactory, false) {
- // TODO(paulberry): we always resynthesize the summary in weak mode. Is
- // this ok?
+ SourceFactory sourceFactory, this.bundle, bool strongMode)
+ : super(null, context, typeProvider, sourceFactory, strongMode) {
for (int i = 0; i < bundle.unlinkedUnitUris.length; i++) {
unlinkedSummaries[bundle.unlinkedUnitUris[i]] = bundle.unlinkedUnits[i];
}
@@ -198,6 +196,7 @@ class SdkSummaryResynthesizer extends SummaryResynthesizer {
* implement [sdkLibraries], [sdkVersion], [uris] and [fromFileUri].
*/
class SummaryBasedDartSdk implements DartSdk {
+ final bool strongMode;
SummaryDataStore _dataStore;
InSummaryPackageUriResolver _uriResolver;
PackageBundle _bundle;
@@ -207,7 +206,7 @@ class SummaryBasedDartSdk implements DartSdk {
*/
InternalAnalysisContext _analysisContext;
- SummaryBasedDartSdk(String summaryPath) {
+ SummaryBasedDartSdk(String summaryPath, this.strongMode) {
_dataStore = new SummaryDataStore(<String>[summaryPath]);
_uriResolver = new InSummaryPackageUriResolver(_dataStore);
_bundle = _dataStore.bundles.single;
@@ -221,11 +220,13 @@ class SummaryBasedDartSdk implements DartSdk {
@override
AnalysisContext get context {
if (_analysisContext == null) {
- _analysisContext = new SdkAnalysisContext(null);
+ AnalysisOptionsImpl analysisOptions = new AnalysisOptionsImpl()
+ ..strongMode = strongMode;
+ _analysisContext = new SdkAnalysisContext(analysisOptions);
SourceFactory factory = new SourceFactory([new DartUriResolver(this)]);
_analysisContext.sourceFactory = factory;
_analysisContext.resultProvider =
- new SdkSummaryResultProvider(_analysisContext, _bundle);
+ new SdkSummaryResultProvider(_analysisContext, _bundle, strongMode);
}
return _analysisContext;
}
« no previous file with comments | « pkg/analyzer/lib/src/generated/sdk_io.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698