@@ -306,10 +306,15 @@ function traceLoad (loader, load, link) {
306
306
loader . loads [ load . key ] = {
307
307
key : load . key ,
308
308
deps : link . dependencies ,
309
+ dynamicDeps : [ ] ,
309
310
depMap : link . depMap || { }
310
311
} ;
311
312
}
312
313
314
+ function traceDynamicLoad ( loader , parentKey , key ) {
315
+ loader . loads [ parentKey ] . dynamicDeps . push ( key ) ;
316
+ }
317
+
313
318
/*
314
319
* Convert a CJS module.exports into a valid object for new Module:
315
320
*
@@ -344,7 +349,7 @@ function registerDeclarative (loader, load, link, declare) {
344
349
locked = false ;
345
350
346
351
return value ;
347
- } , new ContextualLoader ( loader , load . key ) ) ;
352
+ } , new ContextualLoader ( loader , load ) ) ;
348
353
349
354
link . setters = declared . setters ;
350
355
link . execute = declared . execute ;
@@ -502,18 +507,17 @@ function ContextualLoader (loader, key) {
502
507
this . loader = loader ;
503
508
this . key = this . id = key ;
504
509
}
505
- ContextualLoader . prototype . constructor = function ( ) {
510
+ /* ContextualLoader.prototype.constructor = function () {
506
511
throw new TypeError('Cannot subclass the contextual loader only Reflect.Loader.');
507
- } ;
512
+ };*/
508
513
ContextualLoader . prototype . import = function ( key ) {
514
+ if ( loader . trace )
515
+ traceDynamicLoad ( loader , this . key , key ) ;
509
516
return this . loader . import ( key , this . key ) ;
510
517
} ;
511
- ContextualLoader . prototype . resolve = function ( key ) {
518
+ /* ContextualLoader.prototype.resolve = function (key) {
512
519
return this.loader.resolve(key, this.key);
513
- } ;
514
- ContextualLoader . prototype . load = function ( key ) {
515
- return this . loader . load ( key , this . key ) ;
516
- } ;
520
+ };*/
517
521
518
522
// this is the execution function bound to the Module namespace record
519
523
function ensureEvaluate ( loader , load , link , registry , state , seen ) {
0 commit comments