mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-31 03:51:38 +09:00
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:
parent
842b9d47b3
commit
b124e54fc7
2 changed files with 10 additions and 10 deletions
|
|
@ -169,17 +169,13 @@ FetchStreamReader::OnOutputStreamReady(nsIAsyncOutputStream* aStream)
|
|||
return WriteBuffer();
|
||||
}
|
||||
|
||||
AutoJSAPI jsapi;
|
||||
if (NS_WARN_IF(!jsapi.Init(mGlobal))) {
|
||||
CloseAndRelease(NS_ERROR_DOM_INVALID_STATE_ERR);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
// TODO: We need to verify this is the correct global per the spec.
|
||||
// See bug 1385890.
|
||||
AutoEntryScript aes(mGlobal, "ReadableStreamReader.read", !mWorkerHolder);
|
||||
|
||||
JSContext* cx = jsapi.cx();
|
||||
|
||||
JS::Rooted<JSObject*> reader(cx, mReader);
|
||||
JS::Rooted<JSObject*> promise(cx,
|
||||
JS::ReadableStreamDefaultReaderRead(cx,
|
||||
JS::Rooted<JSObject*> reader(aes.cx(), mReader);
|
||||
JS::Rooted<JSObject*> promise(aes.cx(),
|
||||
JS::ReadableStreamDefaultReaderRead(aes.cx(),
|
||||
reader));
|
||||
if (NS_WARN_IF(!promise)) {
|
||||
// Let's close the stream.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue