make worker path detection more robust
This commit is contained in:
parent
1b02f2895e
commit
1f7045732e
1 changed files with 2 additions and 2 deletions
|
|
@ -56,7 +56,7 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, module, classname) {
|
|||
for (var i=0; i<topLevelNamespaces.length; i++) {
|
||||
var ns = topLevelNamespaces[i];
|
||||
var path = this.$normalizePath(require.nameToUrl(ns, null, "_").replace(/.js$/, ""));
|
||||
|
||||
|
||||
tlns[ns] = path;
|
||||
}
|
||||
}
|
||||
|
|
@ -104,7 +104,7 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, module, classname) {
|
|||
|
||||
this.$normalizePath = function(path) {
|
||||
if (!path.match(/^\w+:/))
|
||||
path = location.protocol + "//" + location.host + location.pathname + "/" + path;
|
||||
path = location.protocol + "//" + location.host + location.pathname.replace(/\/.*?$/, "/") + "/" + path;
|
||||
return path;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue