summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/module-code/instn-iee-star-cycle.js
blob: e13e42f94c7bdf81fab020475bd641f304de291c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// |reftest| module
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: >
    Modules can be visited more than once when resolving bindings through
    "star" exports as long as the exportName is different each time.
esid: sec-moduledeclarationinstantiation
info: |
    [...]
    9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do
       a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »).
       [...]

    15.2.1.16.3 ResolveExport( exportName, resolveSet )

    [...]
    3. Append the Record {[[Module]]: module, [[ExportName]]: exportName} to resolveSet.
    4. For each ExportEntry Record e in module.[[LocalExportEntries]], do
       a. If SameValue(exportName, e.[[ExportName]]) is true, then
          i.  Assert: module provides the direct binding for this export.
          ii. Return Record{[[Module]]: module, [[BindingName]]: e.[[LocalName]]}.
    5. For each ExportEntry Record e in module.[[IndirectExportEntries]], do
       a. If SameValue(exportName, e.[[ExportName]]) is true, then
          i.   Assert: module imports a specific binding for this export.
          ii.  Let importedModule be ? HostResolveImportedModule(module, e.[[ModuleRequest]]).
          iii. Return ? importedModule.ResolveExport(e.[[ImportName]], resolveSet).
    [...]
    8. For each ExportEntry Record e in module.[[StarExportEntries]], do
       a. Let importedModule be ? HostResolveImportedModule(module, e.[[ModuleRequest]]).
       b. Let resolution be ? importedModule.ResolveExport(exportName, resolveSet).
       [...]
       d. If resolution is not null, then
          i.  If starResolution is null, let starResolution be resolution.
          [...]
    9. Return starResolution.
flags: [module]
---*/

export { x } from './instn-iee-star-cycle-2_FIXTURE.js';

import * as self from './instn-iee-star-cycle.js';

assert.sameValue(self.x, 45);

reportCompare(0, 0);