Merge pull request from GHSA-h9jc-284h-533g
This commit is contained in:
parent
d0f19d8369
commit
e4c82fdf2d
2 changed files with 13 additions and 11 deletions
|
@ -398,6 +398,8 @@ v8::MaybeLocal<v8::Object> CreateProxyForAPI(
|
|||
context_bridge::ObjectCache* object_cache,
|
||||
int recursion_depth) {
|
||||
gin_helper::Dictionary api(source_context->GetIsolate(), api_object);
|
||||
v8::Context::Scope destination_context_scope(destination_context);
|
||||
{
|
||||
gin_helper::Dictionary proxy =
|
||||
gin::Dictionary::CreateEmpty(destination_context->GetIsolate());
|
||||
object_cache->CacheProxiedObject(api.GetHandle(), proxy.GetHandle());
|
||||
|
@ -409,8 +411,6 @@ v8::MaybeLocal<v8::Object> CreateProxyForAPI(
|
|||
return v8::MaybeLocal<v8::Object>(proxy.GetHandle());
|
||||
auto keys = maybe_keys.ToLocalChecked();
|
||||
|
||||
v8::Context::Scope destination_context_scope(destination_context);
|
||||
{
|
||||
uint32_t length = keys->Length();
|
||||
std::string key_str;
|
||||
for (uint32_t i = 0; i < length; i++) {
|
||||
|
|
|
@ -422,6 +422,7 @@ describe('contextBridge', () => {
|
|||
string: 'string',
|
||||
boolean: true,
|
||||
arr: [123, 'string', true, ['foo']],
|
||||
getObject: () => ({ thing: 123 }),
|
||||
getNumber: () => 123,
|
||||
getString: () => 'string',
|
||||
getBoolean: () => true,
|
||||
|
@ -455,6 +456,7 @@ describe('contextBridge', () => {
|
|||
[example.arr[3][0], String],
|
||||
[example.getNumber, Function],
|
||||
[example.getNumber(), Number],
|
||||
[example.getObject(), Object],
|
||||
[example.getString(), String],
|
||||
[example.getBoolean(), Boolean],
|
||||
[example.getArr(), Array],
|
||||
|
|
Loading…
Add table
Reference in a new issue