From 0718086d97f55d69556a6f0d5b387b005451bc08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 28 Oct 2025 11:18:12 +0100 Subject: [PATCH] Test `export * as x from` and `import * as x; export { x }` binding equivalence --- .../import-and-export-propagates-binding.js | 80 +++++++++++++++++++ ...t-and-export-propagates-binding_FIXTURE.js | 4 + ...-propagates-binding_export-from_FIXTURE.js | 4 + ...gates-binding_import-and-export_FIXTURE.js | 5 ++ .../namespace-empty-module_FIXTURE.js | 2 + ...namespace-export-star-as-from-1_FIXTURE.js | 4 + ...namespace-export-star-as-from-2_FIXTURE.js | 4 + ...ace-import-star-as-and-export-1_FIXTURE.js | 5 ++ ...ace-import-star-as-and-export-2_FIXTURE.js | 5 ++ ...r-as-from-and-import-star-as-and-export.js | 79 ++++++++++++++++++ ...pace-unambiguous-if-export-star-as-from.js | 80 +++++++++++++++++++ ...nambiguous-if-import-star-as-and-export.js | 79 ++++++++++++++++++ 12 files changed, 351 insertions(+) create mode 100644 test/language/module-code/ambiguous-export-bindings/import-and-export-propagates-binding.js create mode 100644 test/language/module-code/ambiguous-export-bindings/import-and-export-propagates-binding_FIXTURE.js create mode 100644 test/language/module-code/ambiguous-export-bindings/import-and-export-propagates-binding_export-from_FIXTURE.js create mode 100644 test/language/module-code/ambiguous-export-bindings/import-and-export-propagates-binding_import-and-export_FIXTURE.js create mode 100644 test/language/module-code/ambiguous-export-bindings/namespace-empty-module_FIXTURE.js create mode 100644 test/language/module-code/ambiguous-export-bindings/namespace-export-star-as-from-1_FIXTURE.js create mode 100644 test/language/module-code/ambiguous-export-bindings/namespace-export-star-as-from-2_FIXTURE.js create mode 100644 test/language/module-code/ambiguous-export-bindings/namespace-import-star-as-and-export-1_FIXTURE.js create mode 100644 test/language/module-code/ambiguous-export-bindings/namespace-import-star-as-and-export-2_FIXTURE.js create mode 100644 test/language/module-code/ambiguous-export-bindings/namespace-unambiguous-if-export-star-as-from-and-import-star-as-and-export.js create mode 100644 test/language/module-code/ambiguous-export-bindings/namespace-unambiguous-if-export-star-as-from.js create mode 100644 test/language/module-code/ambiguous-export-bindings/namespace-unambiguous-if-import-star-as-and-export.js diff --git a/test/language/module-code/ambiguous-export-bindings/import-and-export-propagates-binding.js b/test/language/module-code/ambiguous-export-bindings/import-and-export-propagates-binding.js new file mode 100644 index 0000000000..e7bcdc8cf8 --- /dev/null +++ b/test/language/module-code/ambiguous-export-bindings/import-and-export-propagates-binding.js @@ -0,0 +1,80 @@ +// Copyright (C) 2025 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: A binding re-exported with `export { foo } from` and `import { foo } from; export { foo }` does not cause ambiguity. +esid: sec-source-text-module-record-initialize-environment +info: | + [...] + 7. For each ImportEntry Record in of module.[[ImportEntries]], do + a. Let importedModule be GetImportedModule(module, in.[[ModuleRequest]]). + b. If in.[[ImportName]] is namespace-object, then + i. Let namespace be GetModuleNamespace(importedModule). + ii. Perform ! env.CreateImmutableBinding(in.[[LocalName]], true). + iii. Perform ! env.InitializeBinding(in.[[LocalName]], namespace). + c. Else, + i. Let resolution be importedModule.ResolveExport(in.[[ImportName]]). + ii. If resolution is either null or ambiguous, throw a SyntaxError exception. + + Table 59 (Informative): Export Forms Mappings to ExportEntry Records + + Export Statement Form [[ExportName]] [[ModuleRequest]] [[ImportName]] [[LocalName]] + export {x}; "x" null null "x" + export {x} from "mod"; "x" "mod" "x" null + + 16.2.1.7.1 ParseModule ( sourceText, realm, hostDefined ) + [...] + 10. For each ExportEntry Record ee of exportEntries, do + 1. If ee.[[ModuleRequest]] is null, then + i. If importedBoundNames does not contain ee.[[LocalName]], then + 1. Append ee to localExportEntries. + ii. Else, + 1. Let ie be the element of importEntries whose [[LocalName]] is ee.[[LocalName]]. + 2. If ie.[[ImportName]] is namespace-object, then + a. NOTE: This is a re-export of an imported module namespace object. + b. Append the ExportEntry Record { [[ModuleRequest]]: ie.[[ModuleRequest]], [[ImportName]]: ~all~, [[LocalName]]: *null*, [[ExportName]]: ee.[[ExportName]] } to indirectExportEntries. + 3. Else, + a. NOTE: This is a re-export of a single name. + b. Append the ExportEntry Record { [[ModuleRequest]]: ie.[[ModuleRequest]], + [[ImportName]]: ie.[[ImportName]], [[LocalName]]: null, [[ExportName]]: + ee.[[ExportName]] } to indirectExportEntries. + 2. Else if ee.[[ImportName]] is all-but-default, then + [...] + 3. Else, + a. Append ee to indirectExportEntries. + + 15.2.1.16.3 ResolveExport + + [...] + 6. For each ExportEntry Record e of module.[[IndirectExportEntries]], do + a. If e.[[ExportName]] is exportName, then + i. Assert: e.[[ModuleRequest]] is not null. + ii. Let importedModule be GetImportedModule(module, e.[[ModuleRequest]]). + iii. If e.[[ImportName]] is all, then + 1. Assert: module does not provide the direct binding for this export. + 2. Return ResolvedBinding Record { [[Module]]: importedModule, [[BindingName]]: namespace }. + [...] + 9. Let starResolution be null. + 10. For each ExportEntry Record e in module.[[StarExportEntries]], do + a. Let importedModule be GetImportedModule(module, + e.[[ModuleRequest]]). + b. Let resolution be ? importedModule.ResolveExport(exportName, + resolveSet, exportStarSet). + c. If resolution is ~ambiguous~, return ~ambiguous~. + d. If resolution is not null, then + i. If starResolution is null, let starResolution be resolution. + ii. Else, + 1. Assert: there is more than one * import that includes the + requested name. + 2. If _resolution_.[[Module]] and _starResolution_.[[Module]] are + not the same Module Record, return ~ambiguous~. + 3. If _resolution_.[[BindingName]] is not _starResolution_.[[BindingName]], + return ~ambiguous~. +flags: [module] +---*/ + +export * from "./import-and-export-propagates-binding_export-from_FIXTURE.js"; +export * from "./import-and-export-propagates-binding_import-and-export_FIXTURE.js"; + +import { foo } from './import-and-export-propagates-binding.js'; + +assert.sameValue(foo, 2); diff --git a/test/language/module-code/ambiguous-export-bindings/import-and-export-propagates-binding_FIXTURE.js b/test/language/module-code/ambiguous-export-bindings/import-and-export-propagates-binding_FIXTURE.js new file mode 100644 index 0000000000..f4c246b65f --- /dev/null +++ b/test/language/module-code/ambiguous-export-bindings/import-and-export-propagates-binding_FIXTURE.js @@ -0,0 +1,4 @@ +// Copyright (C) 2025 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +export const foo = 2; diff --git a/test/language/module-code/ambiguous-export-bindings/import-and-export-propagates-binding_export-from_FIXTURE.js b/test/language/module-code/ambiguous-export-bindings/import-and-export-propagates-binding_export-from_FIXTURE.js new file mode 100644 index 0000000000..2e233fcc04 --- /dev/null +++ b/test/language/module-code/ambiguous-export-bindings/import-and-export-propagates-binding_export-from_FIXTURE.js @@ -0,0 +1,4 @@ +// Copyright (C) 2025 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +export { foo } from "./import-and-export-propagates-binding_FIXTURE.js"; diff --git a/test/language/module-code/ambiguous-export-bindings/import-and-export-propagates-binding_import-and-export_FIXTURE.js b/test/language/module-code/ambiguous-export-bindings/import-and-export-propagates-binding_import-and-export_FIXTURE.js new file mode 100644 index 0000000000..e253a087be --- /dev/null +++ b/test/language/module-code/ambiguous-export-bindings/import-and-export-propagates-binding_import-and-export_FIXTURE.js @@ -0,0 +1,5 @@ +// Copyright (C) 2025 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +import { foo } from "./import-and-export-propagates-binding_FIXTURE.js"; +export { foo }; diff --git a/test/language/module-code/ambiguous-export-bindings/namespace-empty-module_FIXTURE.js b/test/language/module-code/ambiguous-export-bindings/namespace-empty-module_FIXTURE.js new file mode 100644 index 0000000000..83f0192f9b --- /dev/null +++ b/test/language/module-code/ambiguous-export-bindings/namespace-empty-module_FIXTURE.js @@ -0,0 +1,2 @@ +// Copyright (C) 2025 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. diff --git a/test/language/module-code/ambiguous-export-bindings/namespace-export-star-as-from-1_FIXTURE.js b/test/language/module-code/ambiguous-export-bindings/namespace-export-star-as-from-1_FIXTURE.js new file mode 100644 index 0000000000..bac7188943 --- /dev/null +++ b/test/language/module-code/ambiguous-export-bindings/namespace-export-star-as-from-1_FIXTURE.js @@ -0,0 +1,4 @@ +// Copyright (C) 2025 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +export * as foo from "./namespace-empty-module_FIXTURE.js"; diff --git a/test/language/module-code/ambiguous-export-bindings/namespace-export-star-as-from-2_FIXTURE.js b/test/language/module-code/ambiguous-export-bindings/namespace-export-star-as-from-2_FIXTURE.js new file mode 100644 index 0000000000..bac7188943 --- /dev/null +++ b/test/language/module-code/ambiguous-export-bindings/namespace-export-star-as-from-2_FIXTURE.js @@ -0,0 +1,4 @@ +// Copyright (C) 2025 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +export * as foo from "./namespace-empty-module_FIXTURE.js"; diff --git a/test/language/module-code/ambiguous-export-bindings/namespace-import-star-as-and-export-1_FIXTURE.js b/test/language/module-code/ambiguous-export-bindings/namespace-import-star-as-and-export-1_FIXTURE.js new file mode 100644 index 0000000000..3f13da5a01 --- /dev/null +++ b/test/language/module-code/ambiguous-export-bindings/namespace-import-star-as-and-export-1_FIXTURE.js @@ -0,0 +1,5 @@ +// Copyright (C) 2025 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +import * as foo from "./namespace-empty-module_FIXTURE.js"; +export { foo }; diff --git a/test/language/module-code/ambiguous-export-bindings/namespace-import-star-as-and-export-2_FIXTURE.js b/test/language/module-code/ambiguous-export-bindings/namespace-import-star-as-and-export-2_FIXTURE.js new file mode 100644 index 0000000000..3f13da5a01 --- /dev/null +++ b/test/language/module-code/ambiguous-export-bindings/namespace-import-star-as-and-export-2_FIXTURE.js @@ -0,0 +1,5 @@ +// Copyright (C) 2025 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +import * as foo from "./namespace-empty-module_FIXTURE.js"; +export { foo }; diff --git a/test/language/module-code/ambiguous-export-bindings/namespace-unambiguous-if-export-star-as-from-and-import-star-as-and-export.js b/test/language/module-code/ambiguous-export-bindings/namespace-unambiguous-if-export-star-as-from-and-import-star-as-and-export.js new file mode 100644 index 0000000000..86034b9a50 --- /dev/null +++ b/test/language/module-code/ambiguous-export-bindings/namespace-unambiguous-if-export-star-as-from-and-import-star-as-and-export.js @@ -0,0 +1,79 @@ +// Copyright (C) 2025 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: Exporting the same namespace object twice with `export * as foo` and `import * as foo; export { foo }` produces an unambiguous binding +esid: sec-source-text-module-record-initialize-environment +info: | + [...] + 7. For each ImportEntry Record in of module.[[ImportEntries]], do + a. Let importedModule be GetImportedModule(module, in.[[ModuleRequest]]). + b. If in.[[ImportName]] is namespace-object, then + i. Let namespace be GetModuleNamespace(importedModule). + ii. Perform ! env.CreateImmutableBinding(in.[[LocalName]], true). + iii. Perform ! env.InitializeBinding(in.[[LocalName]], namespace). + c. Else, + i. Let resolution be importedModule.ResolveExport(in.[[ImportName]]). + ii. If resolution is either null or ambiguous, throw a SyntaxError exception. + + Table 59 (Informative): Export Forms Mappings to ExportEntry Records + + Export Statement Form [[ExportName]] [[ModuleRequest]] [[ImportName]] [[LocalName]] + export * as ns from "mod"; "ns" "mod" all null + + 16.2.1.7.1 ParseModule ( sourceText, realm, hostDefined ) + [...] + 10. For each ExportEntry Record ee of exportEntries, do + 1. If ee.[[ModuleRequest]] is null, then + i. If importedBoundNames does not contain ee.[[LocalName]], then + 1. Append ee to localExportEntries. + ii. Else, + 1. Let ie be the element of importEntries whose [[LocalName]] is ee.[[LocalName]]. + 2. If ie.[[ImportName]] is namespace-object, then + a. NOTE: This is a re-export of an imported module namespace object. + b. Append the ExportEntry Record { [[ModuleRequest]]: ie.[[ModuleRequest]], [[ImportName]]: ~all~, [[LocalName]]: *null*, [[ExportName]]: ee.[[ExportName]] } to indirectExportEntries. + 3. Else, + a. NOTE: This is a re-export of a single name. + b. Append the ExportEntry Record { [[ModuleRequest]]: ie.[[ModuleRequest]], + [[ImportName]]: ie.[[ImportName]], [[LocalName]]: null, [[ExportName]]: + ee.[[ExportName]] } to indirectExportEntries. + 2. Else if ee.[[ImportName]] is all-but-default, then + [...] + 3. Else, + a. Append ee to indirectExportEntries. + + 15.2.1.16.3 ResolveExport + + [...] + 6. For each ExportEntry Record e of module.[[IndirectExportEntries]], do + a. If e.[[ExportName]] is exportName, then + i. Assert: e.[[ModuleRequest]] is not null. + ii. Let importedModule be GetImportedModule(module, e.[[ModuleRequest]]). + iii. If e.[[ImportName]] is all, then + 1. Assert: module does not provide the direct binding for this export. + 2. Return ResolvedBinding Record { [[Module]]: importedModule, [[BindingName]]: namespace }. + [...] + 9. Let starResolution be null. + 10. For each ExportEntry Record e in module.[[StarExportEntries]], do + a. Let importedModule be GetImportedModule(module, + e.[[ModuleRequest]]). + b. Let resolution be ? importedModule.ResolveExport(exportName, + resolveSet, exportStarSet). + c. If resolution is ~ambiguous~, return ~ambiguous~. + d. If resolution is not null, then + i. If starResolution is null, let starResolution be resolution. + ii. Else, + 1. Assert: there is more than one * import that includes the + requested name. + 2. If _resolution_.[[Module]] and _starResolution_.[[Module]] are + not the same Module Record, return ~ambiguous~. + 3. If _resolution_.[[BindingName]] is not _starResolution_.[[BindingName]], + return ~ambiguous~. +flags: [module] +---*/ + +export * from "./namespace-export-star-as-from-1_FIXTURE.js"; +export * from "./namespace-import-star-as-and-export-1_FIXTURE.js"; + +import { foo } from './namespace-unambiguous-if-import-star-as-and-export.js'; + +assert.sameValue(typeof foo, 'object'); diff --git a/test/language/module-code/ambiguous-export-bindings/namespace-unambiguous-if-export-star-as-from.js b/test/language/module-code/ambiguous-export-bindings/namespace-unambiguous-if-export-star-as-from.js new file mode 100644 index 0000000000..5cb86405e2 --- /dev/null +++ b/test/language/module-code/ambiguous-export-bindings/namespace-unambiguous-if-export-star-as-from.js @@ -0,0 +1,80 @@ +// Copyright (C) 2025 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: Exporting the same namespace object twice with `export * as foo` produces an unambiguous binding +esid: sec-source-text-module-record-initialize-environment +info: | + [...] + 7. For each ImportEntry Record in of module.[[ImportEntries]], do + a. Let importedModule be GetImportedModule(module, in.[[ModuleRequest]]). + b. If in.[[ImportName]] is namespace-object, then + i. Let namespace be GetModuleNamespace(importedModule). + ii. Perform ! env.CreateImmutableBinding(in.[[LocalName]], true). + iii. Perform ! env.InitializeBinding(in.[[LocalName]], namespace). + c. Else, + i. Let resolution be importedModule.ResolveExport(in.[[ImportName]]). + ii. If resolution is either null or ambiguous, throw a SyntaxError exception. + + Table 59 (Informative): Export Forms Mappings to ExportEntry Records + + Export Statement Form [[ExportName]] [[ModuleRequest]] [[ImportName]] [[LocalName]] + export {x}; "x" null null "x" + export * as ns from "mod"; "ns" "mod" all null + + 16.2.1.7.1 ParseModule ( sourceText, realm, hostDefined ) + [...] + 10. For each ExportEntry Record ee of exportEntries, do + 1. If ee.[[ModuleRequest]] is null, then + i. If importedBoundNames does not contain ee.[[LocalName]], then + 1. Append ee to localExportEntries. + ii. Else, + 1. Let ie be the element of importEntries whose [[LocalName]] is ee.[[LocalName]]. + 2. If ie.[[ImportName]] is namespace-object, then + a. NOTE: This is a re-export of an imported module namespace object. + b. Append the ExportEntry Record { [[ModuleRequest]]: ie.[[ModuleRequest]], [[ImportName]]: ~all~, [[LocalName]]: *null*, [[ExportName]]: ee.[[ExportName]] } to indirectExportEntries. + 3. Else, + a. NOTE: This is a re-export of a single name. + b. Append the ExportEntry Record { [[ModuleRequest]]: ie.[[ModuleRequest]], + [[ImportName]]: ie.[[ImportName]], [[LocalName]]: null, [[ExportName]]: + ee.[[ExportName]] } to indirectExportEntries. + 2. Else if ee.[[ImportName]] is all-but-default, then + [...] + 3. Else, + a. Append ee to indirectExportEntries. + + 15.2.1.16.3 ResolveExport + + [...] + 6. For each ExportEntry Record e of module.[[IndirectExportEntries]], do + a. If e.[[ExportName]] is exportName, then + i. Assert: e.[[ModuleRequest]] is not null. + ii. Let importedModule be GetImportedModule(module, e.[[ModuleRequest]]). + iii. If e.[[ImportName]] is all, then + 1. Assert: module does not provide the direct binding for this export. + 2. Return ResolvedBinding Record { [[Module]]: importedModule, [[BindingName]]: namespace }. + [...] + 9. Let starResolution be null. + 10. For each ExportEntry Record e in module.[[StarExportEntries]], do + a. Let importedModule be GetImportedModule(module, + e.[[ModuleRequest]]). + b. Let resolution be ? importedModule.ResolveExport(exportName, + resolveSet, exportStarSet). + c. If resolution is ~ambiguous~, return ~ambiguous~. + d. If resolution is not null, then + i. If starResolution is null, let starResolution be resolution. + ii. Else, + 1. Assert: there is more than one * import that includes the + requested name. + 2. If _resolution_.[[Module]] and _starResolution_.[[Module]] are + not the same Module Record, return ~ambiguous~. + 3. If _resolution_.[[BindingName]] is not _starResolution_.[[BindingName]], + return ~ambiguous~. +flags: [module] +---*/ + +export * from "./namespace-export-star-as-from-1_FIXTURE.js"; +export * from "./namespace-export-star-as-from-2_FIXTURE.js"; + +import { foo } from './namespace-unambiguous-if-export-star-as-from.js'; + +assert.sameValue(typeof foo, 'object'); diff --git a/test/language/module-code/ambiguous-export-bindings/namespace-unambiguous-if-import-star-as-and-export.js b/test/language/module-code/ambiguous-export-bindings/namespace-unambiguous-if-import-star-as-and-export.js new file mode 100644 index 0000000000..b340b9be69 --- /dev/null +++ b/test/language/module-code/ambiguous-export-bindings/namespace-unambiguous-if-import-star-as-and-export.js @@ -0,0 +1,79 @@ +// Copyright (C) 2025 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: Exporting the same namespace object twice with `import * as foo; export { foo }` produces an unambiguous binding +esid: sec-source-text-module-record-initialize-environment +info: | + [...] + 7. For each ImportEntry Record in of module.[[ImportEntries]], do + a. Let importedModule be GetImportedModule(module, in.[[ModuleRequest]]). + b. If in.[[ImportName]] is namespace-object, then + i. Let namespace be GetModuleNamespace(importedModule). + ii. Perform ! env.CreateImmutableBinding(in.[[LocalName]], true). + iii. Perform ! env.InitializeBinding(in.[[LocalName]], namespace). + c. Else, + i. Let resolution be importedModule.ResolveExport(in.[[ImportName]]). + ii. If resolution is either null or ambiguous, throw a SyntaxError exception. + + Table 59 (Informative): Export Forms Mappings to ExportEntry Records + + Export Statement Form [[ExportName]] [[ModuleRequest]] [[ImportName]] [[LocalName]] + export * as ns from "mod"; "ns" "mod" all null + + 16.2.1.7.1 ParseModule ( sourceText, realm, hostDefined ) + [...] + 10. For each ExportEntry Record ee of exportEntries, do + 1. If ee.[[ModuleRequest]] is null, then + i. If importedBoundNames does not contain ee.[[LocalName]], then + 1. Append ee to localExportEntries. + ii. Else, + 1. Let ie be the element of importEntries whose [[LocalName]] is ee.[[LocalName]]. + 2. If ie.[[ImportName]] is namespace-object, then + a. NOTE: This is a re-export of an imported module namespace object. + b. Append the ExportEntry Record { [[ModuleRequest]]: ie.[[ModuleRequest]], [[ImportName]]: ~all~, [[LocalName]]: *null*, [[ExportName]]: ee.[[ExportName]] } to indirectExportEntries. + 3. Else, + a. NOTE: This is a re-export of a single name. + b. Append the ExportEntry Record { [[ModuleRequest]]: ie.[[ModuleRequest]], + [[ImportName]]: ie.[[ImportName]], [[LocalName]]: null, [[ExportName]]: + ee.[[ExportName]] } to indirectExportEntries. + 2. Else if ee.[[ImportName]] is all-but-default, then + [...] + 3. Else, + a. Append ee to indirectExportEntries. + + 15.2.1.16.3 ResolveExport + + [...] + 6. For each ExportEntry Record e of module.[[IndirectExportEntries]], do + a. If e.[[ExportName]] is exportName, then + i. Assert: e.[[ModuleRequest]] is not null. + ii. Let importedModule be GetImportedModule(module, e.[[ModuleRequest]]). + iii. If e.[[ImportName]] is all, then + 1. Assert: module does not provide the direct binding for this export. + 2. Return ResolvedBinding Record { [[Module]]: importedModule, [[BindingName]]: namespace }. + [...] + 9. Let starResolution be null. + 10. For each ExportEntry Record e in module.[[StarExportEntries]], do + a. Let importedModule be GetImportedModule(module, + e.[[ModuleRequest]]). + b. Let resolution be ? importedModule.ResolveExport(exportName, + resolveSet, exportStarSet). + c. If resolution is ~ambiguous~, return ~ambiguous~. + d. If resolution is not null, then + i. If starResolution is null, let starResolution be resolution. + ii. Else, + 1. Assert: there is more than one * import that includes the + requested name. + 2. If _resolution_.[[Module]] and _starResolution_.[[Module]] are + not the same Module Record, return ~ambiguous~. + 3. If _resolution_.[[BindingName]] is not _starResolution_.[[BindingName]], + return ~ambiguous~. +flags: [module] +---*/ + +export * from "./namespace-import-star-as-and-export-1_FIXTURE.js"; +export * from "./namespace-import-star-as-and-export-2_FIXTURE.js"; + +import { foo } from './namespace-unambiguous-if-import-star-as-and-export.js'; + +assert.sameValue(typeof foo, 'object');