<html>
    <head>
      <base href="https://bugs.webkit.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - ReadableStream's pipeTo() and pipeThrough() don't handle options in spec-perfect way"
   href="https://bugs.webkit.org/show_bug.cgi?id=227690">227690</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>ReadableStream's pipeTo() and pipeThrough() don't handle options in spec-perfect way
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>WebKit Nightly Build
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>DOM
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned@lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>shvaikalesh@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Streams spec for pipeThrough(): <a href="https://streams.spec.whatwg.org/#rs-pipe-through">https://streams.spec.whatwg.org/#rs-pipe-through</a>
WebIDL spec for dictionary types: <a href="https://heycam.github.io/webidl/#es-dictionary">https://heycam.github.io/webidl/#es-dictionary</a>
Implementation: <a href="https://github.com/WebKit/WebKit/blob/3cd76abcda098f91d46fb0ad42e1eab68b6ddb12/Source/WebCore/Modules/streams/ReadableStream.js#L122">https://github.com/WebKit/WebKit/blob/3cd76abcda098f91d46fb0ad42e1eab68b6ddb12/Source/WebCore/Modules/streams/ReadableStream.js#L122</a>

<span class="quote">> if (@isReadableStreamLocked(this))
>     throw @makeTypeError("ReadableStream is locked");</span >

While this is the first step of pipeThrough() algorithm, it should happen after all arguments (including `options`) are checked / handled.

<span class="quote">> if (options === @undefined)
>     options = { };</span >

This causes properties to queried from Object.prototype; the WebIDL spec doesn't perform [[Get]] for non-objects at all.
@Object.@create(null) may be used instead.

<span class="quote">> let signal;
> if ("signal" in options) {
>     signal = options["signal"];</span >

This is observable is options is a Proxy; the WebIDL spec merely compares [[Get]] result with undefined.

<span class="quote">> const preventClose = !!options["preventClose"];
> const preventAbort = !!options["preventAbort"];
> const preventCancel = !!options["preventCancel"];</span >

For these 3, lookup order matches the member declaration order of Streams spec.
However, the WebIDL spec requires "lexicographical order"; does it translate to 1) "preventAbort" 2) "preventCancel" 3) "preventClose"?
Either way, `options.signal` should be queried after these 3, which is observable by a userland getter.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>