aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/writablestream.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/writablestream.rs')
-rw-r--r--components/script/dom/writablestream.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/components/script/dom/writablestream.rs b/components/script/dom/writablestream.rs
index ec8aaf51a62..25b4812c13d 100644
--- a/components/script/dom/writablestream.rs
+++ b/components/script/dom/writablestream.rs
@@ -650,9 +650,7 @@ impl WritableStream {
// If stream.[[state]] is "closed" or "errored",
if self.is_closed() || self.is_errored() {
// return a promise resolved with undefined.
- let promise = Promise::new(global, can_gc);
- promise.resolve_native(&());
- return promise;
+ return Promise::new_resolved(global, cx, (), can_gc);
}
// TODO: Signal abort on stream.[[controller]].[[abortController]] with reason.