Issue #1442 - Part 15 - Setting the correct global when ReadableStream.getReader() is called. https://bugzilla.mozilla.org/show_bug.cgi?id=1128959

This commit is contained in:
Brian Smith 2023-09-28 19:51:09 -05:00 committed by roytam1
commit b124e54fc7
2 changed files with 10 additions and 10 deletions

View file

@ -1139,6 +1139,10 @@ FetchBody<Derived>::LockStream(JSContext* aCx,
JS::HandleObject aStream,
ErrorResult& aRv)
{
MOZ_ASSERT(JS::ReadableStreamGetMode(aStream) ==
JS::ReadableStreamMode::ExternalSource);
// This is native stream, creating a reader will not execute any JS code.
JS::Rooted<JSObject*> reader(aCx,
JS::ReadableStreamGetReader(aCx, aStream,
JS::ReadableStreamReaderMode::Default));