fix: crash when drag-dropping some files (#46253)
* fix: crash when drag-dropping some files * fix: extra destination context scope
This commit is contained in:
parent
3ae285b614
commit
17e38230d5
1 changed files with 19 additions and 10 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue