mirror of
https://github.com/systemjs/systemjs.git
synced 2026-01-18 14:53:14 +00:00
36 lines
843 B
JavaScript
36 lines
843 B
JavaScript
// SystemJS Loader Class and Extension helpers
|
|
|
|
function SystemJSLoader() {
|
|
SystemLoader.call(this);
|
|
|
|
systemJSConstructor.call(this);
|
|
}
|
|
|
|
// 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;
|
|
}
|
|
|
|
function extend(a, b, underwrite) {
|
|
for (var p in b) {
|
|
if (!underwrite || !(p in a))
|
|
a[p] = b[p];
|
|
}
|
|
} |