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

Commit acf37b8

Browse files
matthewpguybedford
authored andcommitted
Set moduleRecords on the loader
Sets moduleRecords on the loader so that they are not shared when multiple loaders are running at the same time. Fixes #222
1 parent 0d667e2 commit acf37b8

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/loader.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -651,8 +651,8 @@ function logloads(loads) {
651651

652652
// custom module records for binding graph
653653
// store linking module records in a separate table
654-
var moduleRecords = {};
655-
function getOrCreateModuleRecord(name) {
654+
function getOrCreateModuleRecord(name, loader) {
655+
var moduleRecords = loader.moduleRecords;
656656
return moduleRecords[name] || (moduleRecords[name] = {
657657
name: name,
658658
dependencies: [],
@@ -666,7 +666,7 @@ function logloads(loads) {
666666
if (load.module)
667667
return;
668668

669-
var module = load.module = getOrCreateModuleRecord(load.name);
669+
var module = load.module = getOrCreateModuleRecord(load.name, loader);
670670
var moduleObj = load.module.module;
671671

672672
var registryEntry = load.declare.call(__global, function(name, value) {
@@ -713,7 +713,7 @@ function logloads(loads) {
713713
}
714714
// if circular, create the module record
715715
else {
716-
depModule = getOrCreateModuleRecord(depName);
716+
depModule = getOrCreateModuleRecord(depName, loader);
717717
}
718718
}
719719
}
@@ -844,7 +844,8 @@ function logloads(loads) {
844844
loaderObj: this,
845845
loads: [],
846846
modules: {},
847-
importPromises: {}
847+
importPromises: {},
848+
moduleRecords: {}
848849
};
849850

850851
// 26.3.3.6

0 commit comments

Comments
 (0)