mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-06 16:19:23 +00:00
LibWeb: Fulfill TransformStream promises with the correct "reason"
Some checks are pending
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (arm64, macos-15, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (x86_64, ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
Some checks are pending
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (arm64, macos-15, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (x86_64, ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
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());
|
||||
|
|
|
@ -2,8 +2,7 @@ Harness status: OK
|
|||
|
||||
Found 21 tests
|
||||
|
||||
19 Pass
|
||||
2 Fail
|
||||
21 Pass
|
||||
Pass TransformStream errors thrown in transform put the writable and readable in an errored state
|
||||
Pass TransformStream errors thrown in flush put the writable and readable in an errored state
|
||||
Pass errored TransformStream should not enqueue new chunks
|
||||
|
@ -23,5 +22,5 @@ Pass controller.error() should do nothing after readable.cancel() resolves
|
|||
Pass controller.error() should do nothing after writable.abort() has completed
|
||||
Pass controller.error() should do nothing after a transformer method has thrown an exception
|
||||
Pass erroring during write with backpressure should result in the write failing
|
||||
Fail a write() that was waiting for backpressure should reject if the writable is aborted
|
||||
Fail the readable should be errored with the reason passed to the writable abort() method
|
||||
Pass a write() that was waiting for backpressure should reject if the writable is aborted
|
||||
Pass the readable should be errored with the reason passed to the writable abort() method
|
|
@ -2,8 +2,7 @@ Harness status: OK
|
|||
|
||||
Found 11 tests
|
||||
|
||||
10 Pass
|
||||
1 Fail
|
||||
11 Pass
|
||||
Pass enqueue() inside size() should work
|
||||
Pass terminate() inside size() should work
|
||||
Pass error() inside size() should work
|
||||
|
@ -14,4 +13,4 @@ Pass read() inside of size() should work
|
|||
Pass writer.write() inside size() should work
|
||||
Pass synchronous writer.write() inside size() should work
|
||||
Pass writer.close() inside size() should work
|
||||
Fail writer.abort() inside size() should work
|
||||
Pass writer.abort() inside size() should work
|
Loading…
Add table
Add a link
Reference in a new issue