summaryrefslogtreecommitdiffstats
path: root/dom/webtransport
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--dom/webtransport/api/WebTransportDatagramDuplexStream.cpp8
-rw-r--r--dom/webtransport/api/WebTransportDatagramDuplexStream.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/dom/webtransport/api/WebTransportDatagramDuplexStream.cpp b/dom/webtransport/api/WebTransportDatagramDuplexStream.cpp
index 30d7451414..b40991c9a1 100644
--- a/dom/webtransport/api/WebTransportDatagramDuplexStream.cpp
+++ b/dom/webtransport/api/WebTransportDatagramDuplexStream.cpp
@@ -258,7 +258,7 @@ NS_IMPL_ADDREF_INHERITED(OutgoingDatagramStreamAlgorithms,
NS_IMPL_RELEASE_INHERITED(OutgoingDatagramStreamAlgorithms,
UnderlyingSinkAlgorithmsWrapper)
-already_AddRefed<Promise> OutgoingDatagramStreamAlgorithms::WriteCallback(
+already_AddRefed<Promise> OutgoingDatagramStreamAlgorithms::WriteCallbackImpl(
JSContext* aCx, JS::Handle<JS::Value> aChunk,
WritableStreamDefaultController& aController, ErrorResult& aError) {
// https://w3c.github.io/webtransport/#writedatagrams
@@ -269,9 +269,9 @@ already_AddRefed<Promise> OutgoingDatagramStreamAlgorithms::WriteCallback(
// rejected with a TypeError. { BufferSource == ArrayBuffer/ArrayBufferView }
ArrayBufferViewOrArrayBuffer arrayBuffer;
if (!arrayBuffer.Init(aCx, aChunk)) {
- return Promise::CreateRejectedWithTypeError(
- mDatagrams->GetParentObject(),
- "Wrong type for Datagram stream write"_ns, aError);
+ JS_ClearPendingException(aCx);
+ aError.ThrowTypeError("Wrong type for Datagram stream write"_ns);
+ return nullptr;
}
// Step 3: Let datagrams be transport.[[Datagrams]].
diff --git a/dom/webtransport/api/WebTransportDatagramDuplexStream.h b/dom/webtransport/api/WebTransportDatagramDuplexStream.h
index 510cbcac71..a9f8ce7b56 100644
--- a/dom/webtransport/api/WebTransportDatagramDuplexStream.h
+++ b/dom/webtransport/api/WebTransportDatagramDuplexStream.h
@@ -71,7 +71,7 @@ class OutgoingDatagramStreamAlgorithms final
// Streams algorithms
- already_AddRefed<Promise> WriteCallback(
+ already_AddRefed<Promise> WriteCallbackImpl(
JSContext* aCx, JS::Handle<JS::Value> aChunk,
WritableStreamDefaultController& aController,
ErrorResult& aError) override;