| 1 |
// |reftest| error:SyntaxError 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: Named import binding - resolution failure (ambiguous name) |
| 6 |
esid: sec-moduledeclarationinstantiation |
| 7 |
info: | |
| 8 |
[...] |
| 9 |
12. For each ImportEntry Record in in module.[[ImportEntries]], do |
| 10 |
a. Let importedModule be ? HostResolveImportedModule(module, |
| 11 |
in.[[ModuleRequest]]). |
| 12 |
b. If in.[[ImportName]] is "*", then |
| 13 |
[...] |
| 14 |
c. Else, |
| 15 |
i. Let resolution be ? |
| 16 |
importedModule.ResolveExport(in.[[ImportName]], « », « »). |
| 17 |
ii. If resolution is null or resolution is "ambiguous", throw a |
| 18 |
SyntaxError exception. |
| 19 |
|
| 20 |
15.2.1.16.3 ResolveExport |
| 21 |
|
| 22 |
[...] |
| 23 |
9. Let starResolution be null. |
| 24 |
10. For each ExportEntry Record e in module.[[StarExportEntries]], do |
| 25 |
a. Let importedModule be ? HostResolveImportedModule(module, |
| 26 |
e.[[ModuleRequest]]). |
| 27 |
b. Let resolution be ? importedModule.ResolveExport(exportName, |
| 28 |
resolveSet, exportStarSet). |
| 29 |
c. If resolution is "ambiguous", return "ambiguous". |
| 30 |
d. If resolution is not null, then |
| 31 |
i. If starResolution is null, let starResolution be resolution. |
| 32 |
ii. Else, |
| 33 |
1. Assert: there is more than one * import that includes the |
| 34 |
requested name. |
| 35 |
2. If resolution.[[Module]] and starResolution.[[Module]] are |
| 36 |
not the same Module Record or |
| 37 |
SameValue(resolution.[[BindingName]], |
| 38 |
starResolution.[[BindingName]]) is false, return "ambiguous". |
| 39 |
negative: |
| 40 |
phase: resolution |
| 41 |
type: SyntaxError |
| 42 |
flags: [module] |
| 43 |
---*/ |
| 44 |
|
| 45 |
$DONOTEVALUATE(); |
| 46 |
|
| 47 |
import { x } from './instn-named-err-ambiguous_FIXTURE.js'; |