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

Unified Diff: dart/lib/compiler/implementation/dart2js.dart

Issue 10914094: Improve [relativize] for Windows. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 3 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 | dart/lib/compiler/implementation/util/uri_extras.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/lib/compiler/implementation/dart2js.dart
diff --git a/dart/lib/compiler/implementation/dart2js.dart b/dart/lib/compiler/implementation/dart2js.dart
index c427d5c27e2a256e7ad29f2270a3a1f9b3f86e70..dbcea6184c301f19b453c7356cb467ddf96696b5 100644
--- a/dart/lib/compiler/implementation/dart2js.dart
+++ b/dart/lib/compiler/implementation/dart2js.dart
@@ -65,6 +65,7 @@ void parseCommandLine(List<OptionHandler> handlers, List<String> argv) {
}
void compile(List<String> argv) {
+ bool isWindows = (Platform.operatingSystem == 'windows');
Uri cwd = getCurrentDirectory();
bool throwOnError = false;
bool showWarnings = true;
@@ -165,11 +166,12 @@ void compile(List<String> argv) {
try {
source = readAll(uriPathToNative(uri.path));
} on FileIOException catch (ex) {
- throw 'Error: Cannot read "${relativize(cwd, uri)}" (${ex.osError}).';
+ throw 'Error: Cannot read "${relativize(cwd, uri, isWindows)}" '
+ '(${ex.osError}).';
}
dartBytesRead += source.length;
sourceFiles[uri.toString()] =
- new SourceFile(relativize(cwd, uri), source);
+ new SourceFile(relativize(cwd, uri, isWindows), source);
return new Future.immediate(source);
}
@@ -251,10 +253,10 @@ void compile(List<String> argv) {
writeString(out, code);
int jsBytesWritten = code.length;
info('compiled $dartBytesRead bytes Dart -> $jsBytesWritten bytes JS '
- 'in ${relativize(cwd, out)}');
+ 'in ${relativize(cwd, out, isWindows)}');
if (!explicitOut) {
String input = uriPathToNative(arguments[0]);
- String output = relativize(cwd, out);
+ String output = relativize(cwd, out, isWindows);
print('Dart file $input compiled to JavaScript: $output');
}
}
« no previous file with comments | « no previous file | dart/lib/compiler/implementation/util/uri_extras.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698