mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-22 14:35:52 +00:00
Create much fewer CFURLs.
Reviewed by me.
This commit is contained in:
1 parent
981c184c20
commit
d3ba51104e
3 files changed
+8
-7
No files matched your search
@@ -3,5 +3,6 @@ var ObjectiveJ = { };
|
||||
|
||||
(function (global, exports)
|
||||
{
|
||||
var global = (function() { return this; })();
|
||||
#include "Includes.js"
|
||||
})(window, ObjectiveJ);
|
||||
@@ -46,7 +46,7 @@ GLOBAL(CFBundle) = function(/*CFURL|String*/ aURL)
|
||||
CFBundlesForURLStrings[URLString] = this;
|
||||
|
||||
this._bundleURL = aURL;
|
||||
this._resourcesDirectoryURL = new CFURL("Resources/", aURL);
|
||||
this._resourcesDirectoryURL = CFURL("Resources/", aURL);
|
||||
|
||||
this._staticResource = NULL;
|
||||
|
||||
@@ -66,7 +66,7 @@ CFBundle.environments = function()
|
||||
|
||||
CFBundle.bundleContainingURL = function(/*CFURL|String*/ aURL)
|
||||
{
|
||||
aURL = new CFURL(".", makeAbsoluteURL(aURL));
|
||||
aURL = CFURL(".", makeAbsoluteURL(aURL));
|
||||
|
||||
while (aURL.path() !== "/")
|
||||
{
|
||||
@@ -75,7 +75,7 @@ CFBundle.bundleContainingURL = function(/*CFURL|String*/ aURL)
|
||||
if (bundle)
|
||||
return bundle;
|
||||
|
||||
aURL = new CFURL("..", aURL);
|
||||
aURL = CFURL("..", aURL);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -115,7 +115,7 @@ CFBundle.prototype.resourceURL = function(/*String*/ aResourceName, /*String*/ a
|
||||
if (aSubDirectory)
|
||||
aResourceName = aSubDirectory + "/" + aResourceName;
|
||||
|
||||
var resourceURL = (new CFURL(aResourceName, this.resourcesDirectoryURL())).mappedURL();
|
||||
var resourceURL = CFURL(aResourceName, this.resourcesDirectoryURL()).mappedURL();
|
||||
|
||||
return resourceURL.absoluteURL();
|
||||
}
|
||||
@@ -123,7 +123,7 @@ CFBundle.prototype.resourceURL = function(/*String*/ aResourceName, /*String*/ a
|
||||
CFBundle.prototype.mostEligibleEnvironmentURL = function()
|
||||
{
|
||||
if (this._mostEligibleEnvironmentURL === undefined)
|
||||
this._mostEligibleEnvironmentURL = new CFURL(this.mostEligibleEnvironment() + ".environment/", this.bundleURL());
|
||||
this._mostEligibleEnvironmentURL = CFURL(this.mostEligibleEnvironment() + ".environment/", this.bundleURL());
|
||||
|
||||
return this._mostEligibleEnvironmentURL;
|
||||
}
|
||||
@@ -137,7 +137,7 @@ CFBundle.prototype.executableURL = function()
|
||||
if (!executableSubPath)
|
||||
this._executableURL = NULL;
|
||||
else
|
||||
this._executableURL = new CFURL(executableSubPath, this.mostEligibleEnvironmentURL());
|
||||
this._executableURL = CFURL(executableSubPath, this.mostEligibleEnvironmentURL());
|
||||
}
|
||||
|
||||
return this._executableURL;
|
||||
|
||||
@@ -167,7 +167,7 @@ GLOBAL(CFURL) = function(/*CFURL|String*/ aURL, /*CFURL*/ aBaseURL)
|
||||
if (existingBaseURL)
|
||||
aBaseURL = new CFURL(existingBaseURL.absoluteURL(), aBaseURL);
|
||||
|
||||
return new CFURL(aURL.string(), aBaseURL);
|
||||
aURL = aURL.string();
|
||||
}
|
||||
|
||||
// Use the cache if it's enabled.
|
||||
|
||||
Reference in new issue
Block a user