mirror of
https://github.com/servo/servo.git
synced 2025-07-17 04:13:42 +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,
|
chunk: SafeHandleValue,
|
||||||
can_gc: CanGc,
|
can_gc: CanGc,
|
||||||
) -> f64 {
|
) -> f64 {
|
||||||
// If controller.[[strategySizeAlgorithm]] is undefined,
|
// If controller.[[strategySizeAlgorithm]] is undefined, then:
|
||||||
let Some(strategy_size) = self.strategy_size.borrow().clone() else {
|
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 {
|
let Some(stream) = self.stream.get() else {
|
||||||
unreachable!("Controller should have a stream");
|
unreachable!("Controller should have a stream");
|
||||||
};
|
};
|
||||||
assert!(stream.is_erroring() || stream.is_errored());
|
assert!(!stream.is_writable());
|
||||||
|
|
||||||
// Return 1.
|
// Return 1.
|
||||||
return 1.0;
|
return 1.0;
|
||||||
|
|
|
@ -21,9 +21,3 @@
|
||||||
|
|
||||||
[close.any.shadowrealm-in-shadowrealm.html]
|
[close.any.shadowrealm-in-shadowrealm.html]
|
||||||
expected: ERROR
|
expected: ERROR
|
||||||
|
|
||||||
[close.any.worker.html]
|
|
||||||
expected: CRASH
|
|
||||||
|
|
||||||
[close.any.html]
|
|
||||||
expected: CRASH
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue