Bug 1872296 - Use the same global for promise and chunk r=smaug a=pascalc

Differential Revision: https://phabricator.services.mozilla.com/D197938
This commit is contained in:
Kagami Sascha Rosylight 2024-01-29 09:42:55 +00:00
parent 3bb09e70b8
commit fe1b3fa586

View File

@ -607,7 +607,7 @@ void PipeToPump::OnReadFulfilled(JSContext* aCx, JS::Handle<JS::Value> aChunk,
// matches other engines' behavior. See
// https://github.com/whatwg/streams/issues/1243.
RefPtr<Promise> promise =
Promise::CreateInfallible(mWriter->GetParentObject());
Promise::CreateInfallible(xpc::CurrentNativeGlobal(aCx));
promise->MaybeResolveWithUndefined();
auto result = promise->ThenWithCycleCollectedArgsJS(
[](JSContext* aCx, JS::Handle<JS::Value>, ErrorResult& aRv,