2 // Copyright (C) 2016 the V8 project authors. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
6 Modules can be visited more than once when resolving bindings through
7 "star" exports as long as the exportName is different each time.
8 esid: sec-moduledeclarationinstantiation
11 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do
12 a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »).
15 15.2.1.16.3 ResolveExport( exportName, resolveSet )
18 3. Append the Record {[[Module]]: module, [[ExportName]]: exportName} to resolveSet.
19 4. For each ExportEntry Record e in module.[[LocalExportEntries]], do
20 a. If SameValue(exportName, e.[[ExportName]]) is true, then
21 i. Assert: module provides the direct binding for this export.
22 ii. Return Record{[[Module]]: module, [[BindingName]]: e.[[LocalName]]}.
23 5. For each ExportEntry Record e in module.[[IndirectExportEntries]], do
24 a. If SameValue(exportName, e.[[ExportName]]) is true, then
25 i. Assert: module imports a specific binding for this export.
26 ii. Let importedModule be ? HostResolveImportedModule(module, e.[[ModuleRequest]]).
27 iii. Return ? importedModule.ResolveExport(e.[[ImportName]], resolveSet).
29 8. For each ExportEntry Record e in module.[[StarExportEntries]], do
30 a. Let importedModule be ? HostResolveImportedModule(module, e.[[ModuleRequest]]).
31 b. Let resolution be ? importedModule.ResolveExport(exportName, resolveSet).
33 d. If resolution is not null, then
34 i. If starResolution is null, let starResolution be resolution.
36 9. Return starResolution.
40 export { x } from './instn-iee-star-cycle-2_FIXTURE.js';
42 import * as self from './instn-iee-star-cycle.js';
44 assert.sameValue(self.x, 45);