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:
trop[bot]
2026-03-03 10:43:06 +01:00
committed by GitHub
parent fcaf525050
commit c605b21af6

View File

@@ -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);