| 1 |
// |reftest| module |
| 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. |
| 4 |
/*--- |
| 5 |
description: > |
| 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 |
| 9 |
info: | |
| 10 |
[...] |
| 11 |
9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do |
| 12 |
a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). |
| 13 |
[...] |
| 14 |
|
| 15 |
15.2.1.16.3 ResolveExport( exportName, resolveSet ) |
| 16 |
|
| 17 |
[...] |
| 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). |
| 28 |
[...] |
| 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). |
| 32 |
[...] |
| 33 |
d. If resolution is not null, then |
| 34 |
i. If starResolution is null, let starResolution be resolution. |
| 35 |
[...] |
| 36 |
9. Return starResolution. |
| 37 |
flags: [module] |
| 38 |
---*/ |
| 39 |
|
| 40 |
export { x } from './instn-iee-star-cycle-2_FIXTURE.js'; |
| 41 |
|
| 42 |
import * as self from './instn-iee-star-cycle.js'; |
| 43 |
|
| 44 |
assert.sameValue(self.x, 45); |
| 45 |
|
| 46 |
reportCompare(0, 0); |