mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
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:
parent
3ee339eb6d
commit
fc2135cc02
9 changed files with 63 additions and 119 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue