Index: runtime/bin/builtin.dart |
=================================================================== |
--- runtime/bin/builtin.dart (revision 7714) |
+++ runtime/bin/builtin.dart (working copy) |
@@ -23,11 +23,6 @@ |
} |
-// Code to deal with URI resolution for the standalone binary. |
-// For Windows we need to massage the paths a bit according to |
-// http://blogs.msdn.com/b/ie/archive/2006/12/06/file-uris-in-windows.aspx |
-var _is_windows; |
- |
// The URI that the entrypoint script was loaded from. Remembered so that |
// package imports can be resolved relative to it. |
var _entrypoint; |
@@ -48,11 +43,13 @@ |
_packageRoot = packageRoot; |
} |
-String _resolveScriptUri(String cwd, String scriptName, bool windows) { |
- _is_windows = windows; |
+String _resolveScriptUri(String cwd, String scriptName, bool isWindows) { |
_logResolution("# Current working directory: $cwd"); |
_logResolution("# ScriptName: $scriptName"); |
- if (windows) { |
+ if (isWindows) { |
+ // For Windows we need to massage the paths a bit according to |
+ // http://blogs.msdn.com/b/ie/archive/2006/12/06/file-uris-in-windows.aspx |
+ // |
// Convert |
// C:\one\two\three |
// to |
@@ -92,7 +89,7 @@ |
} |
-String _filePathFromUri(String userUri) { |
+String _filePathFromUri(String userUri, bool isWindows) { |
var uri = new Uri.fromString(userUri); |
_logResolution("# Getting file path from: $uri"); |
@@ -113,7 +110,10 @@ |
throw "Not a known scheme: $uri"; |
} |
- if (_is_windows) { |
+ if (isWindows) { |
+ // For Windows we need to massage the paths a bit according to |
+ // http://blogs.msdn.com/b/ie/archive/2006/12/06/file-uris-in-windows.aspx |
+ // |
// Drop the leading / before the drive letter. |
path = path.substring(1); |
_logResolution("# path: $path"); |