[Webkit-unassigned] [Bug 226220] New: ReadableStream.getReader do not throw a proper exception when parameter is of wrong type

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue May 25 06:03:49 PDT 2021


https://bugs.webkit.org/show_bug.cgi?id=226220

            Bug ID: 226220
           Summary: ReadableStream.getReader do not throw a proper
                    exception when parameter is of wrong type
           Product: WebKit
           Version: WebKit Local Build
          Hardware: Unspecified
                OS: Linux
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: New Bugs
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: zyscoder at gmail.com

Steps to reproduce:

(1) Open a tab and navigate to any URL;
(2) Run the following code in the Console of Devtools:
```
b = new Blob();
s = b.stream();
s.getReader(123);
```
(3) Then this code would be evaluated successfully without throwing any exception.

Actual results:

This code is evaluated successfully without throwing any exception.

Expected results:

As https://docs.w3cub.com/dom/readablestream/getreader says, the getReader method accesses an optional parameter containing a property mode, which takes as its value a DOMString specifying the type of reader to create. 
Thus when passing an integer 123 to this API, since 123 is not a dictionary and cannot be converted to a dictionary, an exception should be thrown by Webkit, just like what Chrome and Firefox do.

Evaluating the same code in Chrome and Firefox would throw exceptions:
For Chrome 90.0.4430.212: `VM622:3 Uncaught TypeError: Failed to execute 'getReader' on 'ReadableStream': cannot convert to dictionary.`
For Firefox 89.0b6: `Uncaught TypeError: can't convert 123 to dictionary`

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210525/a81e046a/attachment-0001.htm>


More information about the webkit-unassigned mailing list