systemjs/test/tests/advanced-plugin.js
2013-12-27 11:20:12 +02:00

36 lines
619 B
JavaScript

exports.locate = function(load) {
return {
then: function(resolve, reject) {
setTimeout(function() {
resolve('custom fetch');
}, 20);
}
};
}
exports.fetch = function(load) {
return {
then: function(resolve, reject) {
setTimeout(function() {
resolve(load.address);
}, 20);
}
};
}
exports.translate = function(load) {
return 'q = "' + load.source + '";';
}
exports.instantiate = function(load) {
return {
deps: [],
execute: function() {
var q;
eval(load.source);
return new Module({
q: q + '!'
});
}
};
}