Skip to content

Commit f2ee40e

Browse files
authored
fix writablestream assertion crash when getting chunk size following spec change (servo#36566)
One-line change to align with the new spec and avoid a crash. fix servo#36565 Signed-off-by: Taym Haddadi <[email protected]>
1 parent 5aabe1a commit f2ee40e

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

components/script/dom/writablestreamdefaultcontroller.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -851,13 +851,13 @@ impl WritableStreamDefaultController {
851851
chunk: SafeHandleValue,
852852
can_gc: CanGc,
853853
) -> f64 {
854-
// If controller.[[strategySizeAlgorithm]] is undefined,
854+
// If controller.[[strategySizeAlgorithm]] is undefined, then:
855855
let Some(strategy_size) = self.strategy_size.borrow().clone() else {
856-
// Assert: controller.[[stream]].[[state]] is "erroring" or "errored".
856+
// Assert: controller.[[stream]].[[state]] is not "writable".
857857
let Some(stream) = self.stream.get() else {
858858
unreachable!("Controller should have a stream");
859859
};
860-
assert!(stream.is_erroring() || stream.is_errored());
860+
assert!(!stream.is_writable());
861861

862862
// Return 1.
863863
return 1.0;

tests/wpt/meta/streams/writable-streams/close.any.js.ini

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,3 @@
2121

2222
[close.any.shadowrealm-in-shadowrealm.html]
2323
expected: ERROR
24-
25-
[close.any.worker.html]
26-
expected: CRASH
27-
28-
[close.any.html]
29-
expected: CRASH

0 commit comments

Comments
 (0)