Index: dart/site/try/poi/poi.dart |
diff --git a/dart/site/try/poi/poi.dart b/dart/site/try/poi/poi.dart |
index 478d9b1b23eb6c37d63bdd5ed60ff9f8212a2fe8..6993d1e0c6cd1565f307897caff52daaf3b77f28 100644 |
--- a/dart/site/try/poi/poi.dart |
+++ b/dart/site/try/poi/poi.dart |
@@ -89,6 +89,10 @@ int globalCounter = 0; |
/// really need. |
bool isVerbose = false; |
+/// Enabled by the option --compile. Also compiles the program after analyzing |
+/// the POI. |
+bool isCompiler = false; |
+ |
/// When true (the default value) print serialized scope information at the |
/// provided position. |
const bool PRINT_SCOPE_INFO = |
@@ -150,6 +154,9 @@ main(List<String> arguments) { |
case '--verbose': |
isVerbose = true; |
break; |
+ case '--compile': |
+ isCompiler = true; |
+ break; |
default: |
throw 'Unknown option: $argument.'; |
} |
@@ -365,7 +372,6 @@ Future<Element> runPoi( |
var options = [ |
'--analyze-main', |
- '--analyze-only', |
'--no-source-maps', |
'--verbose', |
'--categories=Client,Server', |
@@ -373,6 +379,10 @@ Future<Element> runPoi( |
'--disable-type-inference', |
]; |
+ if (!isCompiler) { |
+ options.add('--analyze-only'); |
+ } |
+ |
LibraryUpdater updater = |
new LibraryUpdater( |
cachedCompiler, inputProvider, script, printWallClock, printVerbose); |
@@ -389,8 +399,9 @@ Future<Element> runPoi( |
packageRoot: packageRoot, |
packagesAreImmutable: true, |
reuseLibrary: reuseLibrary).then((Compiler newCompiler) { |
- var filter = new ScriptOnlyFilter(script); |
- newCompiler.enqueuerFilter = filter; |
+ if (!isCompiler) { |
+ newCompiler.enqueuerFilter = new ScriptOnlyFilter(script); |
+ } |
return runPoiInternal(newCompiler, sw, updater, position); |
}); |
} |