Commit 4a9718c7 authored by Georg Neis's avatar Georg Neis Committed by Commit Bot

[modules] Blame correct module for ambiguous exports.

The error got attached to the module asking for the conflicting name.
This was incorrect in the case where the asking was itself via a star
export. We must attach the error to the module that explicitly asks
for the problematic name via a named import or named export statement.

Test will be added to Chromium:
https://chromium-review.googlesource.com/c/590369/

R=adamk@chromium.org

Bug: v8:1569
Change-Id: Ib3c297c6c5654ed1b8f2c7b2d6525202c78f87cd
Reviewed-on: https://chromium-review.googlesource.com/591307
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46983}
parent 774a4c5e
......@@ -19727,7 +19727,11 @@ MaybeHandle<Cell> Module::ResolveImport(Handle<Module> module,
must_resolve, resolve_set);
if (isolate->has_pending_exception()) {
DCHECK(result.is_null());
module->RecordError();
if (must_resolve) module->RecordError();
// If {must_resolve} is false and there's an exception, then either that
// exception was already recorded where it happened, or it's the
// kAmbiguousExport exception (see ResolveExportUsingStarExports) and the
// culprit module is still to be determined.
}
return result;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment