mirror of
https://github.com/servo/servo.git
synced 2025-07-16 11:53:39 +01:00
fix writablestream assertion crash when getting chunk size following spec change (#36566)
One-line change to align with the new spec and avoid a crash. fix #36565 Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
This commit is contained in:
parent
5aabe1aa72
commit
f2ee40e40b
2 changed files with 3 additions and 9 deletions
|
@ -851,13 +851,13 @@ impl WritableStreamDefaultController {
|
|||
chunk: SafeHandleValue,
|
||||
can_gc: CanGc,
|
||||
) -> f64 {
|
||||
// If controller.[[strategySizeAlgorithm]] is undefined,
|
||||
// If controller.[[strategySizeAlgorithm]] is undefined, then:
|
||||
let Some(strategy_size) = self.strategy_size.borrow().clone() else {
|
||||
// Assert: controller.[[stream]].[[state]] is "erroring" or "errored".
|
||||
// Assert: controller.[[stream]].[[state]] is not "writable".
|
||||
let Some(stream) = self.stream.get() else {
|
||||
unreachable!("Controller should have a stream");
|
||||
};
|
||||
assert!(stream.is_erroring() || stream.is_errored());
|
||||
assert!(!stream.is_writable());
|
||||
|
||||
// Return 1.
|
||||
return 1.0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue