Fix for loading Cappuccino apps locally on Windows.

Reviewed by me.
This commit is contained in:
Francisco Ryan Tolmasky I
2010-03-30 16:30:45 -07:00
parent 3712da3bba
commit f67dfd85ef
3 changed files with 61 additions and 8 deletions
+7 -1
View File
@@ -143,8 +143,14 @@ StaticResource.resourceAtURL = function(/*CFURL|String*/ aURL, /*BOOL*/ resolveA
resource = resource._children[name];
else if (resolveAsDirectoriesIfNecessary)
resource = new StaticResource(new CFURL(name, resource.URL()), resource, YES, YES);
{
// We do this because on Windows the path may start with C: and be
// misinterpreted as a scheme.
if (name !== "/")
name = "./" + name;
resource = new StaticResource(new CFURL(name, resource.URL()), resource, YES, YES);
}
else
throw new Error("Static Resource at " + aURL + " is not resolved (\"" + name + "\")");
}