mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: use setter's creation context when proxying setter in OverrideGlobalPropertyFromIsolatedWorld (#50020)
The setter branch was deriving source_context from getter-> instead of setter->. Currently latent since the only call site passes both from the same preload context, but this would crash or mis-resolve if a future call site passed a setter without a getter or from a different context. Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Samuel Attard <sattard@anthropic.com>
This commit is contained in:
@@ -905,7 +905,7 @@ bool OverrideGlobalPropertyFromIsolatedWorld(
|
||||
}
|
||||
if (!setter->IsNullOrUndefined() && setter->IsObject()) {
|
||||
v8::Local<v8::Context> source_context =
|
||||
getter->GetCreationContextChecked(isolate);
|
||||
setter.As<v8::Object>()->GetCreationContextChecked(isolate);
|
||||
v8::MaybeLocal<v8::Value> maybe_setter_proxy = PassValueToOtherContext(
|
||||
isolate, source_context, isolate, main_context, setter,
|
||||
source_context->Global(), false, BridgeErrorTarget::kSource);
|
||||
|
||||
Reference in New Issue
Block a user