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

Unified Diff: bin/builtin.dart

Issue 9608028: - D:\rive\letters (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 9 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 | bin/main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bin/builtin.dart
===================================================================
--- bin/builtin.dart (revision 5135)
+++ bin/builtin.dart (working copy)
@@ -23,17 +23,35 @@
// Code to deal with URI resolution for the standalone binary.
+var _is_windows;
+
void _logResolution(String msg) {
final enabled = false;
- if (enabled) {
+ if (enabled || _is_windows) {
_Logger._printString(msg);
}
}
// TODO(iposva): Make these private once the Dart API is fixed.
-String resolveScriptUri(String cwd, String scriptName) {
+String resolveScriptUri(String cwd, String scriptName, bool windows) {
+ _is_windows = windows;
_logResolution("# Current working directory: $cwd");
_logResolution("# ScriptName: $scriptName");
+ if (windows) {
+ // Convert
+ // C:\one\two\three
+ // to
+ // /C:/one/two/three
+ cwd = "/${cwd.replaceAll('\\', '/')}";
+ _logResolution("## cwd: $cwd");
+ if ((scriptName.length > 2) && (scriptName[1] == ":")) {
+ // This is an absolute path.
+ scriptName = "/${scriptName.replaceAll('\\', '/')}";
+ } else {
+ scriptName = scriptName.replaceAll('\\', '/');
+ }
+ _logResolution("## scriptName: $scriptName");
+ }
var base = new Uri(scheme: "file", path: cwd.endsWith("/") ? cwd : "$cwd/");
var resolved = base.resolve(scriptName);
_logResolution("# Resolved to: $resolved");
« no previous file with comments | « no previous file | bin/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698