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

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

Issue 300043012: Communicate defined variables to the context (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add missed type Created 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/analyzer_impl.dart
diff --git a/pkg/analyzer/lib/src/analyzer_impl.dart b/pkg/analyzer/lib/src/analyzer_impl.dart
index e25cee54dd2fe2bf5d97943a2bb6e8c5b682abf2..d6aa8b57d6d611aa886e05a19942b4ca27a64979 100644
--- a/pkg/analyzer/lib/src/analyzer_impl.dart
+++ b/pkg/analyzer/lib/src/analyzer_impl.dart
@@ -10,6 +10,7 @@ import 'dart:io';
import 'package:path/path.dart' as pathos;
+import 'generated/constant.dart';
import 'generated/engine.dart';
import 'generated/element.dart';
import 'generated/error.dart';
@@ -251,6 +252,13 @@ class AnalyzerImpl {
sourceFactory = new SourceFactory(resolvers);
context = AnalysisEngine.instance.createAnalysisContext();
context.sourceFactory = sourceFactory;
+ Map<String, String> definedVariables = options.definedVariables;
+ if (!definedVariables.isEmpty) {
+ DeclaredVariables declaredVariables = context.declaredVariables;
+ definedVariables.forEach((String variableName, String value) {
+ declaredVariables.define(variableName, value);
+ });
+ }
// Uncomment the following to have errors reported on stdout and stderr
AnalysisEngine.instance.logger = new StdLogger(options.log);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698