mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-06 01:26:22 +00: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: 38142eaf53
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/95
1 changed files with 3 additions and 6 deletions
|
@ -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:
|
// 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) {
|
auto cancel_algorithm = JS::create_heap_function(realm.heap(), [&stream](JS::Value reason) {
|
||||||
// 1. Perform ! TransformStreamErrorWritableAndUnblockWrite(stream, reason).
|
// 1. Return ! TransformStreamDefaultSourceCancelAlgorithm(stream, reason).
|
||||||
transform_stream_error_writable_and_unblock_write(stream, reason);
|
return transform_stream_default_source_cancel_algorithm(stream, reason);
|
||||||
|
|
||||||
// 2. Return a promise resolved with undefined.
|
|
||||||
return WebIDL::create_resolved_promise(realm, JS::js_undefined());
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// 8. Set stream.[[readable]] to ! CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, readableHighWaterMark, readableSizeAlgorithm).
|
// 8. Set stream.[[readable]] to ! CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, readableHighWaterMark, readableSizeAlgorithm).
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue