fix: crash when drag-dropping some files (#46311)

* fix: crash when drag-dropping some files

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* fix: extra destination context scope

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
trop[bot]
2025-03-26 22:23:24 -05:00
committed by GitHub
parent 39cbd0c27c
commit 2b4716253d

View File

@@ -687,17 +687,26 @@ v8::MaybeLocal<v8::Object> CreateProxyForAPI(
continue;
}
}
v8::Local<v8::Value> value;
if (!api.Get(key, &value))
continue;
auto passed_value = PassValueToOtherContextInner(
source_context, source_execution_context, destination_context, value,
api.GetHandle(), object_cache, support_dynamic_properties,
recursion_depth + 1, error_target);
if (passed_value.IsEmpty())
return {};
proxy.Set(key, passed_value.ToLocalChecked());
{
v8::Context::Scope source_context_scope(source_context);
v8::Local<v8::Value> value;
if (!api.Get(key, &value))
continue;
auto passed_value = PassValueToOtherContextInner(
source_context, source_execution_context, destination_context,
value, api.GetHandle(), object_cache, support_dynamic_properties,
recursion_depth + 1, error_target);
if (passed_value.IsEmpty())
return {};
{
v8::Context::Scope inner_destination_context_scope(
destination_context);
proxy.Set(key, passed_value.ToLocalChecked());
}
}
}
return proxy.GetHandle();