This commit is contained in:
2022-07-18 02:50:52 +00:00
parent befd344ab0
commit 06181b34d6
8569 changed files with 818704 additions and 352705 deletions
@@ -27,6 +27,8 @@ class ExportMode {
this.name = null;
/** @type {Map<string, string>} */
this.map = EMPTY_MAP;
/** @type {Set<string>|null} */
this.ignored = null;
/** @type {Module|null} */
this.module = null;
/** @type {string|null} */
@@ -212,6 +214,11 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency {
const mode = new ExportMode("dynamic-reexport");
mode.module = importedModule;
mode.ignored = new Set([
"default",
...this.activeExports,
...activeFromOtherStarExports
]);
return mode;
}
@@ -580,10 +587,7 @@ HarmonyExportImportedSpecifierDependency.Template = class HarmonyExportImportedS
.join("");
case "dynamic-reexport": {
const activeExports = new Set([
...dep.activeExports,
...dep._discoverActiveExportsFromOtherStartExports()
]);
const ignoredExports = mode.ignored;
let content =
"/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in " +
importVar +
@@ -591,10 +595,10 @@ HarmonyExportImportedSpecifierDependency.Template = class HarmonyExportImportedS
// Filter out exports which are defined by other exports
// and filter out default export because it cannot be reexported with *
if (activeExports.size > 0) {
if (ignoredExports.size > 0) {
content +=
"if(" +
JSON.stringify(Array.from(activeExports).concat("default")) +
JSON.stringify(Array.from(ignoredExports)) +
".indexOf(__WEBPACK_IMPORT_KEY__) < 0) ";
} else {
content += "if(__WEBPACK_IMPORT_KEY__ !== 'default') ";