Skip to content

Commit

Permalink
Merge pull request #11873 from webpack/bugfix/11863
Browse files Browse the repository at this point in the history
handle the case when execution order in a concatenated module is runtime-dependent
  • Loading branch information
sokra committed Oct 29, 2020
2 parents 9ed55a0 + 1849515 commit 64f84a2
Show file tree
Hide file tree
Showing 13 changed files with 308 additions and 100 deletions.
15 changes: 9 additions & 6 deletions lib/ConcatenationScope.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,19 @@ const NAMESPACE_OBJECT_EXPORT = "__WEBPACK_NAMESPACE_OBJECT__";

class ConcatenationScope {
/**
* @param {ModuleInfo[]} modulesWithInfo all module info in order
* @param {ModuleInfo[] | Map<Module, ModuleInfo>} modulesMap all module info by module
* @param {ConcatenatedModuleInfo} currentModule the current module info
*/
constructor(modulesWithInfo, currentModule) {
constructor(modulesMap, currentModule) {
this._currentModule = currentModule;
this._modulesWithInfo = modulesWithInfo;
this._modulesMap = new Map();
for (const info of modulesWithInfo) {
this._modulesMap.set(info.module, info);
if (Array.isArray(modulesMap)) {
const map = new Map();
for (const info of modulesMap) {
map.set(info.module, info);
}
modulesMap = map;
}
this._modulesMap = modulesMap;
}

/**
Expand Down

0 comments on commit 64f84a2

Please sign in to comment.