Fixed: CFBundle.prototype.bundleURL() did not return an absolute URL.

CFBundle internally stores its URL in relative form, and returned that relative URL in the bundleURL() function. However, in Cocoa an absolute URL is returned. It is reasonable to assume an absolute URL would be expected by some asking for the bundle's URL. Even within CFBundle, most times bundleURL() is called it is followed with absoluteURL().

This commit returns an absolute URL from bundleURL().
This commit is contained in:
Aparajita Fishman committed 2013-04-06 15:51:09 -04:00
1 parent 486bff44df
commit cc2503ac0f
1 file changed
+3 -3
+3 -3
View File
@@ -133,7 +133,7 @@ DISPLAY_NAME(CFBundle.bundleWithIdentifier);
CFBundle.prototype.bundleURL = function()
{
return this._bundleURL;
return this._bundleURL.absoluteURL();
};
DISPLAY_NAME(CFBundle.prototype.bundleURL);
@@ -285,7 +285,7 @@ CFBundle.prototype.load = function(/*BOOL*/ shouldExecute)
StaticResource.resolveResourceAtURL(parentURL, YES, function(aStaticResource)
{
var resourceName = bundleURL.absoluteURL().lastPathComponent();
var resourceName = bundleURL.lastPathComponent();
self._staticResource = aStaticResource._children[resourceName] ||
new StaticResource(bundleURL, aStaticResource, YES, NO);
@@ -721,7 +721,7 @@ DISPLAY_NAME(CFBundle.prototype.onerror);
CFBundle.prototype.bundlePath = function()
{
return this._bundleURL.absoluteURL().path();
return this.bundleURL().path();
};
CFBundle.prototype.path = function()