зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1818630 - Crash in [@ mozilla::dom::ReadableStreamReaderGenericRelease]. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D172057
This commit is contained in:
Родитель
31457ab0f2
Коммит
99238aafa7
|
@ -952,6 +952,14 @@ already_AddRefed<Promise> ReadableStream::IteratorReturn(
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
MOZ_DIAGNOSTIC_ASSERT(
|
||||
reader->GetStream(),
|
||||
"We shouldn't have a null stream here (bug 1821169).");
|
||||
if (!reader->GetStream()) {
|
||||
aRv.Throw(NS_ERROR_FAILURE);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Step 4.2. Perform ! ReadableStreamDefaultReaderRelease(reader).
|
||||
ReadableStreamDefaultReaderRelease(aCx, reader, aRv);
|
||||
if (NS_WARN_IF(aRv.Failed())) {
|
||||
|
|
|
@ -285,7 +285,7 @@ void ReadableStreamReaderGenericRelease(ReadableStreamGenericReader* aReader,
|
|||
|
||||
// Step 4. If stream.[[state]] is "readable", reject reader.[[closedPromise]]
|
||||
// with a TypeError exception.
|
||||
if (aReader->GetStream()->State() == ReadableStream::ReaderState::Readable) {
|
||||
if (stream->State() == ReadableStream::ReaderState::Readable) {
|
||||
aReader->ClosedPromise()->MaybeRejectWithTypeError(
|
||||
"Releasing lock on readable stream");
|
||||
} else {
|
||||
|
|
Загрузка…
Ссылка в новой задаче