Index: pkg/analyzer/lib/src/context/context.dart |
diff --git a/pkg/analyzer/lib/src/context/context.dart b/pkg/analyzer/lib/src/context/context.dart |
index 90d5ffc96b8aff72b7f2d1f9b53442209b9a84b0..6c0de9e04dcdfc0d9c36120c1582124359723c79 100644 |
--- a/pkg/analyzer/lib/src/context/context.dart |
+++ b/pkg/analyzer/lib/src/context/context.dart |
@@ -2173,7 +2173,23 @@ abstract class ResultProvider { |
* An [AnalysisContext] that only contains sources for a Dart SDK. |
*/ |
class SdkAnalysisContext extends AnalysisContextImpl { |
+ /** |
+ * Initialize a newly created SDK analysis context with the given [options]. |
+ * Analysis options cannot be changed afterwards. If the given [options] are |
+ * `null`, then default options are used. |
+ */ |
+ SdkAnalysisContext(AnalysisOptions options) { |
+ if (options != null) { |
+ super.analysisOptions = options; |
+ } |
+ } |
+ |
@override |
+ void set analysisOptions(AnalysisOptions options) { |
+ throw new StateError('AnalysisOptions of SDK context cannot be changed.'); |
+ } |
+ |
+ @override |
AnalysisCache createCacheFromSourceFactory(SourceFactory factory) { |
if (factory == null) { |
return super.createCacheFromSourceFactory(factory); |