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

Unified Diff: pkg/analyzer/lib/src/context/context.dart

Issue 1830703002: Pass AnalysisOptions into SdkCreator, disable changing afterwards. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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/source/embedder.dart ('k') | pkg/analyzer/lib/src/generated/sdk.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « pkg/analyzer/lib/source/embedder.dart ('k') | pkg/analyzer/lib/src/generated/sdk.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698