implement Writablestreamdefaultcontroller abortcontroller (#37511)

using abort signal and abortcontroller in
Writablestreamdefaultcontroller

Part of https://github.com/servo/servo/issues/34866

---------

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
This commit is contained in:
Taym Haddadi 2025-06-18 08:26:05 -07:00 committed by GitHub
parent 3ee339eb6d
commit fc2135cc02
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 63 additions and 119 deletions

View file

@ -738,7 +738,7 @@ impl PipeTo {
let promise = match action {
ShutdownAction::WritableStreamAbort => {
let dest = self.writer.get_stream().expect("Stream must be set");
dest.abort(cx, global, error.handle(), can_gc)
dest.abort(cx, global, error.handle(), realm, can_gc)
},
ShutdownAction::ReadableStreamCancel => {
let source = self
@ -771,7 +771,7 @@ impl PipeTo {
// If dest.[[state]] is "writable",
let promise = if dest.is_writable() {
// return ! WritableStreamAbort(dest, error)
dest.abort(cx, global, error.handle(), can_gc)
dest.abort(cx, global, error.handle(), realm, can_gc)
} else {
// Otherwise, return a promise resolved with undefined.
Promise::new_resolved(global, cx, (), can_gc)