parent
79e4c4a104
commit
2ca8fa6e66
5 changed files with 16 additions and 7 deletions
|
|
@ -8,7 +8,6 @@ require.$$current = function() {
|
|||
var pathnameEnd = searchIndex > -1 ? searchIndex : hashIndex > -1 ? hashIndex : href.length
|
||||
try {throw new Error} catch (e) {var error = e}
|
||||
var src = error.stack.match(/^(?:(?!^Error|\/module\/module\.js).)*$/m).toString().match(/((?:file|https|http):\/\/.+)(?::\d+){2}/)[1] || href.slice(0, pathnameEnd)
|
||||
var base = href.slice(0, href.lastIndexOf("/", pathnameEnd) + 1)
|
||||
return src.replace(/\.js$/, "")
|
||||
}
|
||||
|
||||
|
|
@ -26,4 +25,4 @@ function require(name) {
|
|||
while (dotdot.test(absolute)) absolute = absolute.replace(dotdot, "")
|
||||
if (absolute in require.$$modules) return require.$$modules[absolute]
|
||||
else throw new Error("Module does not exist: " + absolute)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue