2015-09-09 21:44:09 +02:00
|
|
|
(function(exports) {
|
|
|
|
exports.AMDLC_TESTS = true;
|
|
|
|
|
|
|
|
function resolve(id) {
|
|
|
|
var i, target = exports, fragments = id.split(/[.\/]/);
|
|
|
|
|
|
|
|
for (i = 0; i < fragments.length; i++) {
|
|
|
|
if (!target[fragments[i]]) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
target = target[fragments[i]];
|
|
|
|
}
|
|
|
|
|
|
|
|
return target;
|
|
|
|
}
|
|
|
|
|
|
|
|
function require(ids, callback) {
|
|
|
|
var i, module, defs = [], privateModules = exports.privateModules || {};
|
|
|
|
|
|
|
|
for (i = 0; i < ids.length; i++) {
|
|
|
|
module = privateModules[ids[i]] || resolve(ids[i]);
|
|
|
|
|
|
|
|
if (!module) {
|
2016-01-20 05:17:22 +01:00
|
|
|
throw 'module definition dependency not found: ' + ids[i];
|
2015-09-09 21:44:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
defs.push(module);
|
|
|
|
}
|
|
|
|
|
|
|
|
callback.apply(null, defs);
|
|
|
|
}
|
|
|
|
|
|
|
|
exports.ModuleLoader = {
|
|
|
|
require: require
|
|
|
|
};
|
|
|
|
})(this);
|