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

Unified Diff: lib/src/compiler/command.dart

Issue 2279833002: fix writing summaries (Closed)
Patch Set: Created 4 years, 4 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: lib/src/compiler/command.dart
diff --git a/lib/src/compiler/command.dart b/lib/src/compiler/command.dart
index 5fb8b05fae6973702d8f32541ee2922ce249123b..13ab330a267a4feed55c4c485dc8a950b7b50e41 100644
--- a/lib/src/compiler/command.dart
+++ b/lib/src/compiler/command.dart
@@ -103,7 +103,7 @@ void _compile(ArgResults argResults, void printFn(Object obj)) {
// TODO(jmesserly): for now the first one is special. This will go away once
// we've removed the "root" and "module name" variables.
- var outPath = outPaths[0];
+ var firstOutPath = outPaths[0];
var libraryRoot = argResults['library-root'] as String;
libraryRoot ??= argResults['build-root'] as String;
@@ -116,35 +116,35 @@ void _compile(ArgResults argResults, void printFn(Object obj)) {
String modulePath;
if (moduleRoot != null) {
moduleRoot = path.absolute(moduleRoot);
- if (!path.isWithin(moduleRoot, outPath)) {
- _usageException('Output file $outPath must be within the module root '
- 'directory $moduleRoot');
+ if (!path.isWithin(moduleRoot, firstOutPath)) {
+ _usageException('Output file $firstOutPath must be within the module '
+ 'root directory $moduleRoot');
}
modulePath =
- path.withoutExtension(path.relative(outPath, from: moduleRoot));
+ path.withoutExtension(path.relative(firstOutPath, from: moduleRoot));
} else {
- moduleRoot = path.dirname(outPath);
- modulePath = path.basenameWithoutExtension(outPath);
+ moduleRoot = path.dirname(firstOutPath);
+ modulePath = path.basenameWithoutExtension(firstOutPath);
}
var unit = new BuildUnit(modulePath, libraryRoot, argResults.rest,
(source) => _moduleForLibrary(moduleRoot, source, compilerOpts));
- JSModuleFile module = compiler.compile(unit, compilerOpts);
+ var module = compiler.compile(unit, compilerOpts);
module.errors.forEach(printFn);
if (!module.isValid) throw new CompileErrorException();
// Write JS file, as well as source map and summary (if requested).
for (var i = 0; i < outPaths.length; i++) {
- module.writeCodeSync(moduleFormats[i], outPaths[i]);
+ var outPath = outPaths[i];
+ module.writeCodeSync(moduleFormats[i], outPath);
if (module.summaryBytes != null) {
var summaryPath =
path.withoutExtension(outPath) + '.${compilerOpts.summaryExtension}';
new File(summaryPath).writeAsBytesSync(module.summaryBytes);
}
}
-
}
String _moduleForLibrary(
« 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