systemjs/lib/core.js
2015-05-12 13:54:06 +02:00

29 lines
751 B
JavaScript

// SystemJS Loader Class and Extension helpers
function SystemJSLoader(options) {
SystemLoader.call(this, options);
systemJSConstructor.call(this, options);
}
// inline Object.create-style class extension
function SystemProto() {};
SystemProto.prototype = SystemLoader.prototype;
SystemJSLoader.prototype = new SystemProto();
var systemJSConstructor;
function hook(name, hook) {
SystemJSLoader.prototype[name] = hook(SystemJSLoader.prototype[name]);
}
function hookConstructor(hook) {
systemJSConstructor = hook(systemJSConstructor || function() {});
}
function dedupe(deps) {
var newDeps = [];
for (var i = 0, l = deps.length; i < l; i++)
if (indexOf.call(newDeps, deps[i]) == -1)
newDeps.push(deps[i])
return newDeps;
}