mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb: Fulfill TransformStream promises with the correct "reason"
We need to use the reason provided to the abort algorithm, not the one from the resolved cancel promise (which will be undefined).
This commit is contained in:
parent
f6438e83b8
commit
955f6fc9cb
Notes:
github-actions[bot]
2025-04-16 17:16:31 +00:00
Author: https://github.com/trflynn89
Commit: 955f6fc9cb
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4378
Reviewed-by: https://github.com/kennethmyhra ✅
3 changed files with 6 additions and 8 deletions
|
|
@ -5438,7 +5438,7 @@ GC::Ref<WebIDL::Promise> transform_stream_default_sink_abort_algorithm(Transform
|
|||
// 7. React to cancelPromise:
|
||||
WebIDL::react_to_promise(cancel_promise,
|
||||
// 1. If cancelPromise was fulfilled, then:
|
||||
GC::create_function(realm.heap(), [&realm, readable, controller](JS::Value reason) -> WebIDL::ExceptionOr<JS::Value> {
|
||||
GC::create_function(realm.heap(), [&realm, readable, controller, reason](JS::Value) -> WebIDL::ExceptionOr<JS::Value> {
|
||||
// 1. If readable.[[state]] is "errored", reject controller.[[finishPromise]] with readable.[[storedError]].
|
||||
if (readable->state() == ReadableStream::State::Errored) {
|
||||
WebIDL::reject_promise(realm, *controller->finish_promise(), readable->stored_error());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue