mirror of
https://github.com/servo/servo.git
synced 2025-06-17 04:44:28 +00:00
Fix ReadableStream cancel error message (#37282)
Align error message with WHATWG Streams spec by changing: - `'stream is not locked'` to `'stream is locked'` This will match the step 2 of the readablestream cancel method that requires the correct TypeError when the stream is locked. Signed-off-by: Alice Okingo <annekadiso@gmail.com>
This commit is contained in:
parent
a328aa474b
commit
c7eba2dbba
1 changed files with 1 additions and 1 deletions
|
@ -1926,7 +1926,7 @@ impl ReadableStreamMethods<crate::DomTypeHolder> for ReadableStream {
|
|||
// If ! IsReadableStreamLocked(this) is true,
|
||||
// return a promise rejected with a TypeError exception.
|
||||
let promise = Promise::new(&global, can_gc);
|
||||
promise.reject_error(Error::Type("stream is not locked".to_owned()), can_gc);
|
||||
promise.reject_error(Error::Type("stream is locked".to_owned()), can_gc);
|
||||
promise
|
||||
} else {
|
||||
// Return ! ReadableStreamCancel(this, reason).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue