Skip to content
This repository was archived by the owner on Jul 13, 2020. It is now read-only.

Commit

Permalink
add import.meta contextual object support
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed May 29, 2017
1 parent e0c90fe commit be374db
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions core/register-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,6 @@ function traceLoad (loader, load, link) {
};
}

function traceDynamicLoad (loader, parentKey, key) {
loader.loads[parentKey].dynamicDeps.push(key);
}

/*
* Convert a CJS module.exports into a valid object for new Module:
*
Expand Down Expand Up @@ -475,17 +471,21 @@ RegisterLoader.prototype.registerDynamic = function (key, deps, executingRequire
};

// ContextualLoader class
// backwards-compatible with previous System.register context argument by exposing .id
// backwards-compatible with previous System.register context argument by exposing .id, .key
function ContextualLoader (loader, key) {
this.loader = loader;
this.key = this.id = key;
this.meta = {
url: key
// scriptElement: null
};
}
/*ContextualLoader.prototype.constructor = function () {
throw new TypeError('Cannot subclass the contextual loader only Reflect.Loader.');
};*/
ContextualLoader.prototype.import = function (key) {
if (this.loader.trace)
traceDynamicLoad(this.loader, this.key, key);
this.loader.loads[this.key].dynamicDeps.push(key);
return this.loader.import(key, this.key);
};
/*ContextualLoader.prototype.resolve = function (key) {
Expand Down

0 comments on commit be374db

Please sign in to comment.