pull/85/head
nightwing 2015-04-12 21:56:12 +04:00 zatwierdzone przez nightwing
rodzic cb01f0e76f
commit d33f396a17
1 zmienionych plików z 6 dodań i 4 usunięć

Wyświetl plik

@ -315,11 +315,11 @@ function resolveModulePath(id, pathMap) {
testPath = "/" + testPath; testPath = "/" + testPath;
while (testPath) { while (testPath) {
if (pathMap[testPath]) { if (pathMap[testPath]) {
return pathMap[testPath] + (tail && "/" + tail); return pathMap[testPath] + tail;
} }
var i = testPath.lastIndexOf("/"); var i = testPath.lastIndexOf("/");
if (i === -1) break; if (i === -1) break;
tail = testPath.substr(i + 1) + (tail && "/" + tail); tail = testPath.substr(i) + tail;
testPath = testPath.slice(0, i); testPath = testPath.slice(0, i);
} }
return id; return id;
@ -375,13 +375,15 @@ function wrapUMD(module) {
+ ' if (typeof deps == "function") {\n' + ' if (typeof deps == "function") {\n'
+ ' m = deps; deps = [];\n' + ' m = deps; deps = [];\n'
+ ' }\n' + ' }\n'
+ ' if (typeof m != "function") {\n'
+ ' deps = m; m = null;\n'
+ ' }\n'
+ ' var ret = m ? m.apply(_.module, deps.map(function(n){return _[n] || require(n)})) : deps\n' + ' var ret = m ? m.apply(_.module, deps.map(function(n){return _[n] || require(n)})) : deps\n'
+ ' if (ret) _.module.exports = ret;\n' + ' if (ret) _.module.exports = ret;\n'
+ '}\n' + '}\n'
+ 'define.amd = true;' + 'define.amd = true;'
+ module.source + module.source
+ '});'; + '});';
} }
function debugSrc(module) { function debugSrc(module) {