diff options
-rw-r--r-- | cli/tests/wpt.jsonc | 17 | ||||
-rw-r--r-- | op_crates/fetch/11_streams.js | 22 |
2 files changed, 29 insertions, 10 deletions
diff --git a/cli/tests/wpt.jsonc b/cli/tests/wpt.jsonc index 2f9573875..e207a9f90 100644 --- a/cli/tests/wpt.jsonc +++ b/cli/tests/wpt.jsonc @@ -8,7 +8,7 @@ "piping/flow-control", // "piping/general", "piping/multiple-propagation", - // "piping/pipe-through", + "piping/pipe-through", "piping/then-interception", // "piping/throwing-options", // "piping/transform-streams", @@ -134,8 +134,12 @@ // TODO(lucacasonato): uses XMLHttpRequest unnecessarily. should be fixed upstream before enabling // "unsupported-encodings", ], - "dom": ["abort/event"], - "hr-time": ["monotonic-clock"], + "dom": [ + "abort/event" + ], + "hr-time": [ + "monotonic-clock" + ], "html": [ "webappapis/microtask-queuing/queue-microtask-exceptions.any", "webappapis/microtask-queuing/queue-microtask.any", @@ -183,7 +187,6 @@ "webapi/status", "webapi/create_multiple_memory", "create_multiple_memory" - //FAILING TESTS // "jsapi/constructor/instantiate-bad-imports", // "jsapi/constructor/instantiate", @@ -225,7 +228,9 @@ "console-namespace-object-class-string", "console-tests-historical" ], - "WebCryptoApi": ["getRandomValues"], + "WebCryptoApi": [ + "getRandomValues" + ], "WebIDL": [ "ecmascript-binding/es-exceptions/DOMException-constants", "ecmascript-binding/es-exceptions/DOMException-constructor-and-prototype", @@ -242,4 +247,4 @@ ] } ] -} +}
\ No newline at end of file diff --git a/op_crates/fetch/11_streams.js b/op_crates/fetch/11_streams.js index 827f8c232..b7a9acca0 100644 --- a/op_crates/fetch/11_streams.js +++ b/op_crates/fetch/11_streams.js @@ -3136,21 +3136,35 @@ * @returns {ReadableStream<T>} */ pipeThrough( - { readable, writable }, + transform, { preventClose, preventAbort, preventCancel, signal } = {}, ) { + if (!isReadableStream(this)) { + throw new TypeError("this must be a ReadableStream"); + } + const { readable } = transform; + if (!isReadableStream(readable)) { + throw new TypeError("readable must be a ReadableStream"); + } + const { writable } = transform; + if (!isWritableStream(writable)) { + throw new TypeError("writable must be a WritableStream"); + } if (isReadableStreamLocked(this)) { throw new TypeError("ReadableStream is already locked."); } + if (signal !== undefined && !(signal instanceof AbortSignal)) { + throw new TypeError("signal must be an AbortSignal"); + } if (isWritableStreamLocked(writable)) { throw new TypeError("Target WritableStream is already locked."); } const promise = readableStreamPipeTo( this, writable, - preventClose, - preventAbort, - preventCancel, + Boolean(preventClose), + Boolean(preventAbort), + Boolean(preventCancel), signal, ); setPromiseIsHandledToTrue(promise); |