Browse Source

LibWeb: Update cancel_algorithm steps in AO initialize_transform_stream

Kenneth Myhra 1 năm trước cách đây
mục cha
commit
38142eaf53
1 tập tin đã thay đổi với 3 bổ sung6 xóa
  1. 3 6
      Userland/Libraries/LibWeb/Streams/AbstractOperations.cpp

+ 3 - 6
Userland/Libraries/LibWeb/Streams/AbstractOperations.cpp

@@ -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).