Issue #1442 - Part 17 - Creating FetchStream as a out param in order to avoid JS hazards https://bugzilla.mozilla.org/show_bug.cgi?id=1128959

This commit is contained in:
Brian Smith 2023-09-28 22:06:25 -05:00 committed by roytam1
commit e22845913d
3 changed files with 22 additions and 17 deletions

View file

@ -1097,12 +1097,9 @@ FetchBody<Derived>::GetBody(JSContext* aCx,
return;
}
JS::Rooted<JSObject*> body(aCx,
FetchStream::Create(aCx,
this,
DerivedClass()->GetParentObject(),
inputStream,
aRv));
JS::Rooted<JSObject*> body(aCx);
FetchStream::Create(aCx, this, DerivedClass()->GetParentObject(),
inputStream, &body, aRv);
if (NS_WARN_IF(aRv.Failed())) {
return;
}