share baseURI from module loader wrapper

This commit is contained in:
guybedford 2015-05-16 13:44:26 +02:00
parent d0eef8fd07
commit 24e9d4e4b2

View File

@ -2,7 +2,6 @@ var absURLRegEx = /^[^\/]+:\/\//;
// caches baseURL URL object
// also allows baseURL to be relative to the baseURI
var baseURI;
function getAbsBaseURL() {
var baseURL = this.baseURL;
return baseURLCache[baseURL] = baseURLCache[baseURL] || new URL(baseURL + (baseURL[baseURL.length - 1] != '/' ? '/' : ''), baseURI);
@ -14,9 +13,6 @@ hookConstructor(function(constructor) {
return function() {
constructor.call(this);
// by default ModuleLoader sets this.baseURL to baseURI
baseURI = this.baseURL;
// support the empty module, as a concept
this.set('@empty', this.newModule({}));
};