mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
LibWeb: Widen assertion to avoid accidentally writing to a closed stream
This widens the assertion from only checking if the WritableStream's state is Errored or Erroring to asserting that the WritableStream is not in a Writable state.
This commit is contained in:
parent
6ba60188b4
commit
b285202951
Notes:
github-actions[bot]
2025-04-14 18:51:59 +00:00
Author: https://github.com/kennethmyhra
Commit: b285202951
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4355
Reviewed-by: https://github.com/trflynn89 ✅
4 changed files with 530 additions and 2 deletions
|
@ -4974,8 +4974,8 @@ JS::Value writable_stream_default_controller_get_chunk_size(WritableStreamDefaul
|
|||
{
|
||||
// 1. If controller.[[strategySizeAlgorithm]] is undefined, then:
|
||||
if (!controller.strategy_size_algorithm()) {
|
||||
// 1. Assert: controller.[[stream]].[[state]] is "erroring" or "errored".
|
||||
VERIFY(controller.stream()->state() == WritableStream::State::Erroring || controller.stream()->state() == WritableStream::State::Errored);
|
||||
// 1. Assert: controller.[[stream]].[[state]] is not "writable".
|
||||
VERIFY(controller.stream()->state() != WritableStream::State::Writable);
|
||||
|
||||
// 2. Return 1.
|
||||
return JS::Value { 1.0 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue