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

Unified Diff: pkg/analyzer/lib/src/generated/sdk_io.dart

Issue 1734773003: Fix for using the strong mode SDK summary. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | pkg/analyzer_cli/lib/src/package_analyzer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/sdk_io.dart
diff --git a/pkg/analyzer/lib/src/generated/sdk_io.dart b/pkg/analyzer/lib/src/generated/sdk_io.dart
index e7a9dea30194b81d94102ea65bd55b7b6d4fc78a..6f03a84708270f3404cd5d8ca78a711fffb19137 100644
--- a/pkg/analyzer/lib/src/generated/sdk_io.dart
+++ b/pkg/analyzer/lib/src/generated/sdk_io.dart
@@ -9,8 +9,8 @@ import 'dart:io';
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/src/context/context.dart';
-import 'package:analyzer/src/dart/scanner/scanner.dart';
import 'package:analyzer/src/dart/scanner/reader.dart';
+import 'package:analyzer/src/dart/scanner/scanner.dart';
import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/generated/error.dart';
import 'package:analyzer/src/generated/java_core.dart';
@@ -264,14 +264,6 @@ class DirectoryBasedDartSdk implements DartSdk {
_analysisContext = new SdkAnalysisContext();
SourceFactory factory = new SourceFactory([new DartUriResolver(this)]);
_analysisContext.sourceFactory = factory;
- // Try to use summaries.
- if (_useSummary) {
- PackageBundle sdkBundle = _getSummarySdkBundle();
- if (sdkBundle != null) {
- _analysisContext.resultProvider =
- new SdkSummaryResultProvider(_analysisContext, sdkBundle);
- }
- }
}
return _analysisContext;
}
@@ -398,14 +390,17 @@ class DirectoryBasedDartSdk implements DartSdk {
List<String> get uris => _libraryMap.uris;
/**
- * Specify whether SDK summary should be used. This property can only be set
- * before [context] is invoked.
+ * Specify whether SDK summary should be used.
*/
void set useSummary(bool use) {
- if (_analysisContext != null) {
- throw new StateError('SDK analysis context has been already created.');
- }
_useSummary = use;
+ if (_useSummary) {
+ PackageBundle sdkBundle = _getSummarySdkBundle();
+ if (sdkBundle != null) {
+ _analysisContext.resultProvider =
+ new SdkSummaryResultProvider(_analysisContext, sdkBundle);
+ }
+ }
}
/**
@@ -557,7 +552,9 @@ class DirectoryBasedDartSdk implements DartSdk {
*/
PackageBundle _getSummarySdkBundle() {
String rootPath = directory.getAbsolutePath();
- String path = pathos.join(rootPath, 'lib', '_internal', 'spec.sum');
+ String name =
+ context.analysisOptions.strongMode ? 'strong.sum' : 'spec.sum';
+ String path = pathos.join(rootPath, 'lib', '_internal', name);
try {
File file = new File(path);
if (file.existsSync()) {
« no previous file with comments | « no previous file | pkg/analyzer_cli/lib/src/package_analyzer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698