mirror of
https://github.com/systemjs/systemjs.git
synced 2026-01-25 14:57:38 +00:00
corrected fix for #751
This commit is contained in:
parent
b1fc92bbfa
commit
91b7bc01cb
12
lib/cjs.js
12
lib/cjs.js
@ -38,7 +38,7 @@
|
||||
}
|
||||
|
||||
if (typeof window != 'undefined' && typeof document != 'undefined' && window.location)
|
||||
var windowOrigin = location.protocol + '//' + (location.protocol == 'file:' && location.hostname[0] != '/' ? '/' : '') + location.hostname + (location.port ? ':' + location.port : '');
|
||||
var windowOrigin = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '');
|
||||
|
||||
hookConstructor(function(constructor) {
|
||||
return function() {
|
||||
@ -91,11 +91,7 @@
|
||||
dirname.pop();
|
||||
dirname = dirname.join('/');
|
||||
|
||||
if (windowOrigin && address.substr(0, windowOrigin.length) === windowOrigin) {
|
||||
address = address.substr(windowOrigin.length);
|
||||
dirname = dirname.substr(windowOrigin.length);
|
||||
}
|
||||
else if (address.substr(0, 8) == 'file:///') {
|
||||
if (address.substr(0, 8) == 'file:///') {
|
||||
address = address.substr(7);
|
||||
dirname = dirname.substr(7);
|
||||
|
||||
@ -105,6 +101,10 @@
|
||||
dirname = dirname.substr(1);
|
||||
}
|
||||
}
|
||||
else if (windowOrigin && address.substr(0, windowOrigin.length) === windowOrigin) {
|
||||
address = address.substr(windowOrigin.length);
|
||||
dirname = dirname.substr(windowOrigin.length);
|
||||
}
|
||||
|
||||
// disable AMD detection
|
||||
var define = __global.define;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user