From 737cd420f5c9f05b0a15d13460b918d54da60f8b Mon Sep 17 00:00:00 2001 From: Narcis Beleuzu Date: Fri, 26 Oct 2018 21:12:32 +0300 Subject: [PATCH] Backed out changeset 2c6e366ebc6e (bug 1502028) for wpt failures on pipe-through.dedicatedworker.html. CLOSED TREE --- js/src/builtin/Stream.cpp | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/js/src/builtin/Stream.cpp b/js/src/builtin/Stream.cpp index 5b51dc3bfaff..aae55aa88d78 100644 --- a/js/src/builtin/Stream.cpp +++ b/js/src/builtin/Stream.cpp @@ -1140,11 +1140,27 @@ ReadableStream_getReader(JSContext* cx, unsigned argc, Value* vp) return true; } -// Streams spec, 3.2.5.4. pipeThrough({ writable, readable }, options) -// Not implemented. +// Streams spec, 3.2.4.4. pipeThrough({ writable, readable }, options) +static MOZ_MUST_USE bool +ReadableStream_pipeThrough(JSContext* cx, unsigned argc, Value* vp) +{ + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAM_METHOD_NOT_IMPLEMENTED, "pipeThrough"); + return false; + // // Step 1: Perform ? Invoke(this, "pipeTo", « writable, options »). -// Streams spec, 3.2.5.5. pipeTo(dest, { preventClose, preventAbort, preventCancel } = {}) -// Not implemented. + // // Step 2: Return readable. +} + +// Streams spec, 3.2.4.5. pipeTo(dest, { preventClose, preventAbort, preventCancel } = {}) +// TODO: Unimplemented since spec is not complete yet. +static MOZ_MUST_USE bool +ReadableStream_pipeTo(JSContext* cx, unsigned argc, Value* vp) +{ + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAM_METHOD_NOT_IMPLEMENTED, "pipeTo"); + return false; +} static MOZ_MUST_USE bool ReadableStreamTee(JSContext* cx, Handle stream, bool cloneForBranch2, @@ -1186,6 +1202,8 @@ ReadableStream_tee(JSContext* cx, unsigned argc, Value* vp) static const JSFunctionSpec ReadableStream_methods[] = { JS_FN("cancel", ReadableStream_cancel, 1, 0), JS_FN("getReader", ReadableStream_getReader, 0, 0), + JS_FN("pipeThrough", ReadableStream_pipeThrough, 2, 0), + JS_FN("pipeTo", ReadableStream_pipeTo, 1, 0), JS_FN("tee", ReadableStream_tee, 0, 0), JS_FS_END };