Commit d3e6e046 authored by Sam Sebree's avatar Sam Sebree Committed by Commit Bot

[SyntheticModules] Synthetic Module Export String Fix

This is a very small change which must go in before
https://chromium-review.googlesource.com/c/chromium/src/+/1731108
is able to land.

Certain WPT tests for synthetic modules were spawning DCHECK crashes by JSObject::SetNormalizedProperty.

Export names were previously failing:
DCHECK(name->IsUniqueName());

This small change corrects the issue and allows Module::GetModuleNamespace to run correctly.
This change aligns synthetic module behavior for export string storage with JS modules, as well as the spec.

chromium: 967018
Change-Id: I151e7150290bd72d4e4753c8c5be243eafae915f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1761583Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63264}
parent 3b45da47
......@@ -2342,7 +2342,8 @@ Local<Module> Module::CreateSyntheticModule(
i::Handle<i::FixedArray> i_export_names = i_isolate->factory()->NewFixedArray(
static_cast<int>(export_names.size()));
for (int i = 0; i < i_export_names->length(); ++i) {
i::Handle<i::String> str = Utils::OpenHandle(*export_names[i]);
i::Handle<i::String> str = i_isolate->factory()->InternalizeString(
Utils::OpenHandle(*export_names[i]));
i_export_names->set(i, *str);
}
return v8::Utils::ToLocal(
......
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