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

Unified Diff: lib/src/compiler.dart

Issue 1762283003: Various cleanup (Closed) Base URL: https://github.com/dart-lang/dev_compiler.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 | « lib/src/codegen/side_effect_analysis.dart ('k') | lib/src/report/html_reporter.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/compiler.dart
diff --git a/lib/src/compiler.dart b/lib/src/compiler.dart
index c4e66221377248e846dc75c71b91e9bfecb6b240..7b4b11a90d23330f71321cf20a69aab3b6822f08 100644
--- a/lib/src/compiler.dart
+++ b/lib/src/compiler.dart
@@ -277,7 +277,10 @@ class BatchCompiler extends AbstractCompiler {
var loadedLibs = new LinkedHashSet<Uri>();
- var htmlOutDir = path.dirname(getOutputPath(source.uri));
+ // If we're generating code, convert the HTML file as well.
ochafik 2016/03/04 23:27:57 +1 !
+ // Otherwise, just search for Dart sources to analyze.
+ var htmlOutDir =
+ _jsGen != null ? path.dirname(getOutputPath(source.uri)) : null;
for (var script in scripts) {
Source scriptSource = null;
var srcAttr = script.attributes['src'];
@@ -300,12 +303,16 @@ class BatchCompiler extends AbstractCompiler {
if (scriptSource != null) {
var lib = context.computeLibraryElement(scriptSource);
_compileLibrary(lib, notifier);
- script.replaceWith(_linkLibraries(lib, loadedLibs, from: htmlOutDir));
+ if (htmlOutDir != null) {
+ script.replaceWith(_linkLibraries(lib, loadedLibs, from: htmlOutDir));
+ }
}
}
- fileSystem.writeAsStringSync(
- getOutputPath(source.uri), document.outerHtml + '\n');
+ if (htmlOutDir != null) {
+ fileSystem.writeAsStringSync(
+ getOutputPath(source.uri), document.outerHtml + '\n');
+ }
}
html.DocumentFragment _linkLibraries(
« no previous file with comments | « lib/src/codegen/side_effect_analysis.dart ('k') | lib/src/report/html_reporter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698