mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 13:36:13 +03:00
LibWeb: Update cancel_algorithm steps in AO initialize_transform_stream
This commit is contained in:
parent
e848249b8d
commit
38142eaf53
Notes:
sideshowbarker
2024-07-17 18:23:22 +09:00
Author: https://github.com/kennethmyhra Commit: https://github.com/LadybirdBrowser/ladybird/commit/38142eaf53 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/95
@ -4742,12 +4742,9 @@ void initialize_transform_stream(TransformStream& stream, JS::NonnullGCPtr<JS::P
|
||||
});
|
||||
|
||||
// 7. Let cancelAlgorithm be the following steps, taking a reason argument:
|
||||
auto cancel_algorithm = JS::create_heap_function(realm.heap(), [&stream, &realm](JS::Value reason) {
|
||||
// 1. Perform ! TransformStreamErrorWritableAndUnblockWrite(stream, reason).
|
||||
transform_stream_error_writable_and_unblock_write(stream, reason);
|
||||
|
||||
// 2. Return a promise resolved with undefined.
|
||||
return WebIDL::create_resolved_promise(realm, JS::js_undefined());
|
||||
auto cancel_algorithm = JS::create_heap_function(realm.heap(), [&stream](JS::Value reason) {
|
||||
// 1. Return ! TransformStreamDefaultSourceCancelAlgorithm(stream, reason).
|
||||
return transform_stream_default_source_cancel_algorithm(stream, reason);
|
||||
});
|
||||
|
||||
// 8. Set stream.[[readable]] to ! CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, readableHighWaterMark, readableSizeAlgorithm).
|
||||
|
Loading…
Reference in New Issue
Block a user