Fix for loading Cappuccino apps locally on Windows.

Reviewed by me.
This commit is contained in:
Francisco Ryan Tolmasky I committed 2010-03-30 16:28:42 -07:00
1 parent 0b3264a99d
commit 9255af210c
3 files changed
+61 -8

No files matched your search

+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 + "\")");
}