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

Commit be374db

Browse files
committed
add import.meta contextual object support
1 parent e0c90fe commit be374db

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

core/register-loader.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -311,10 +311,6 @@ function traceLoad (loader, load, link) {
311311
};
312312
}
313313

314-
function traceDynamicLoad (loader, parentKey, key) {
315-
loader.loads[parentKey].dynamicDeps.push(key);
316-
}
317-
318314
/*
319315
* Convert a CJS module.exports into a valid object for new Module:
320316
*
@@ -475,17 +471,21 @@ RegisterLoader.prototype.registerDynamic = function (key, deps, executingRequire
475471
};
476472

477473
// ContextualLoader class
478-
// backwards-compatible with previous System.register context argument by exposing .id
474+
// backwards-compatible with previous System.register context argument by exposing .id, .key
479475
function ContextualLoader (loader, key) {
480476
this.loader = loader;
481477
this.key = this.id = key;
478+
this.meta = {
479+
url: key
480+
// scriptElement: null
481+
};
482482
}
483483
/*ContextualLoader.prototype.constructor = function () {
484484
throw new TypeError('Cannot subclass the contextual loader only Reflect.Loader.');
485485
};*/
486486
ContextualLoader.prototype.import = function (key) {
487487
if (this.loader.trace)
488-
traceDynamicLoad(this.loader, this.key, key);
488+
this.loader.loads[this.key].dynamicDeps.push(key);
489489
return this.loader.import(key, this.key);
490490
};
491491
/*ContextualLoader.prototype.resolve = function (key) {

0 commit comments

Comments
 (0)