mirror of
https://github.com/systemjs/systemjs.git
synced 2026-01-25 14:57:38 +00:00
backwards compat for #1008
This commit is contained in:
parent
d32a45dad2
commit
b6013907eb
16
lib/core.js
16
lib/core.js
@ -138,7 +138,7 @@ hook('normalize', function(normalize) {
|
||||
|
||||
if (name.match(absURLRegEx)) {
|
||||
// defaultJSExtensions backwards compatibility
|
||||
if (this.defaultJSExtensions && name.substr(name.length - 3, 3) != '.js')
|
||||
if (this.defaultJSExtensions && name.substr(name.length - 3, 3) != '.js' && !this.defined[name])
|
||||
name += '.js';
|
||||
return name;
|
||||
}
|
||||
@ -146,16 +146,18 @@ hook('normalize', function(normalize) {
|
||||
// applyPaths implementation provided from ModuleLoader system.js source
|
||||
name = applyPaths(this.paths, name) || name;
|
||||
|
||||
// defaultJSExtensions backwards compatibility
|
||||
if (this.defaultJSExtensions && name.substr(name.length - 3, 3) != '.js')
|
||||
name += '.js';
|
||||
|
||||
// ./x, /x -> page-relative
|
||||
if (name[0] == '.' || name[0] == '/')
|
||||
return new URL(name, baseURIObj).href;
|
||||
name = new URL(name, baseURIObj).href;
|
||||
// x -> baseURL-relative
|
||||
else
|
||||
return new URL(name, getBaseURLObj.call(this)).href;
|
||||
name = new URL(name, getBaseURLObj.call(this)).href;
|
||||
|
||||
// defaultJSExtensions backwards compatibility
|
||||
if (this.defaultJSExtensions && name.substr(name.length - 3, 3) != '.js' && !this.defined[name])
|
||||
name += '.js';
|
||||
|
||||
return name;
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user