Commit a6ab2ae6 authored by Marja Hölttä's avatar Marja Hölttä Committed by V8 LUCI CQ

[web snapshots] Fix empty export name handling

Bug: v8:11525
Change-Id: I5e8e3b60b9f308b7ef384d5e7bc0bba149b5b81b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3477105Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79208}
parent df696e72
......@@ -231,7 +231,7 @@ bool WebSnapshotSerializer::TakeSnapshot(v8::Local<v8::Context> context,
for (int i = 0, length = exports->Length(); i < length; ++i) {
v8::Local<v8::String> str =
exports->Get(v8_isolate, i)->ToString(context).ToLocalChecked();
if (str.IsEmpty()) {
if (str->Length() == 0) {
continue;
}
v8::ScriptCompiler::Source source(str);
......@@ -254,6 +254,9 @@ bool WebSnapshotSerializer::TakeSnapshot(v8::Local<v8::Context> context,
for (int i = 0, length = exports->Length(); i < length; ++i) {
v8::Local<v8::String> str =
exports->Get(v8_isolate, i)->ToString(context).ToLocalChecked();
if (str->Length() == 0) {
continue;
}
SerializeExport(export_objects[i],
Handle<String>::cast(Utils::OpenHandle(*str)));
}
......
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