Skip to content

Commit 61644fd

Browse files
nicolo-ribaudojonco3
authored andcommitted
Bug 2002191 - Align indirect and direct module namespace re-exports r=jonco
This patch implements tc39/ecma262#3715, to make import * as ns from "mod"; export { ns }; behave the same as export * as ns from "mod"; Tested by tc39/test262#4606 Differential Revision: https://phabricator.services.mozilla.com/D274013
1 parent 4421148 commit 61644fd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

js/src/builtin/ModuleObject.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1698,13 +1698,17 @@ bool ModuleBuilder::buildTables(frontend::StencilModuleMetadata& metadata) {
16981698
return false;
16991699
}
17001700
} else {
1701+
// All names should have already been marked as used-by-stencil.
17011702
if (!importEntry->importName) {
1702-
if (!metadata.localExportEntries.append(exp)) {
1703+
// This is a re-export of an imported module namespace object.
1704+
auto entry = frontend::StencilModuleEntry::exportNamespaceFromEntry(
1705+
importEntry->moduleRequest, exp.exportName, exp.lineno,
1706+
exp.column);
1707+
if (!metadata.indirectExportEntries.append(entry)) {
17031708
js::ReportOutOfMemory(fc_);
17041709
return false;
17051710
}
17061711
} else {
1707-
// All names should have already been marked as used-by-stencil.
17081712
auto entry = frontend::StencilModuleEntry::exportFromEntry(
17091713
importEntry->moduleRequest, importEntry->importName,
17101714
exp.exportName, exp.lineno, exp.column);

0 commit comments

Comments
 (0)