зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1840626 - Fix debug Crash [@ mozilla::dom::ReadableStream::CloseNative] r=saschanaz
The assertion dereferences Algorithms(), which could have been freed, so only assert if it exists. Differential Revision: https://phabricator.services.mozilla.com/D187149
This commit is contained in:
Родитель
63ebdf7b61
Коммит
aaedb8e230
|
@ -1345,8 +1345,8 @@ already_AddRefed<ReadableStream> ReadableStream::CreateByteNative(
|
|||
|
||||
// https://streams.spec.whatwg.org/#readablestream-close
|
||||
void ReadableStream::CloseNative(JSContext* aCx, ErrorResult& aRv) {
|
||||
MOZ_ASSERT(mController->GetAlgorithms()->IsNative());
|
||||
|
||||
MOZ_ASSERT_IF(mController->GetAlgorithms(),
|
||||
mController->GetAlgorithms()->IsNative());
|
||||
// Step 1: If stream.[[controller]] implements ReadableByteStreamController,
|
||||
if (mController->IsByte()) {
|
||||
RefPtr<ReadableByteStreamController> controller = mController->AsByte();
|
||||
|
|
|
@ -65,3 +65,13 @@ add_task(async function test_webtransport_create() {
|
|||
|
||||
wt.close();
|
||||
});
|
||||
|
||||
// bug 1840626 - cancel and then close
|
||||
add_task(async function test_wt_stream_create_bidi_cancel_close() {
|
||||
let wt = new WebTransport("https://" + host + "/success");
|
||||
await wt.ready;
|
||||
|
||||
await wt.createBidirectionalStream();
|
||||
await wt.incomingBidirectionalStreams.cancel(undefined);
|
||||
wt.close();
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче