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:
parent
39cbd0c27c
commit
2b4716253d
1 changed files with 19 additions and 10 deletions
|
@ -687,17 +687,26 @@ v8::MaybeLocal<v8::Object> CreateProxyForAPI(
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
v8::Local<v8::Value> value;
|
|
||||||
if (!api.Get(key, &value))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
auto passed_value = PassValueToOtherContextInner(
|
{
|
||||||
source_context, source_execution_context, destination_context, value,
|
v8::Context::Scope source_context_scope(source_context);
|
||||||
api.GetHandle(), object_cache, support_dynamic_properties,
|
v8::Local<v8::Value> value;
|
||||||
recursion_depth + 1, error_target);
|
if (!api.Get(key, &value))
|
||||||
if (passed_value.IsEmpty())
|
continue;
|
||||||
return {};
|
|
||||||
proxy.Set(key, passed_value.ToLocalChecked());
|
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();
|
return proxy.GetHandle();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue