Summary: | ReadableStream.getReader do not throw a proper exception when parameter is of wrong type | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | zyscoder <zyscoder> | ||||||||
Component: | Bindings | Assignee: | youenn fablet <youennf> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | benjamin, calvaris, cdumez, ews-watchlist, gsnedders, joepeck, webkit-bug-importer, youennf | ||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||
Version: | WebKit Local Build | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Linux | ||||||||||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=226215 | ||||||||||
Attachments: |
|
Description
zyscoder@gmail.com
2021-05-25 06:03:49 PDT
See also 226215 for another bindings bug with dictionary types. This is not using regular IDL in WebKit so I am deferring to Youenn on this one. It seems getReader() is implemented in JS? Created attachment 432680 [details]
Patch
Created attachment 432693 [details]
Patch
Comment on attachment 432693 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=432693&action=review > Source/WebCore/Modules/streams/ReadableStream.js:103 > + // FIXME: We check for @undefined and null to match Chrome and WPT tests, we should check whether we can remove those checks. This FIXME is wrong. We are doing this change to match the spec and other browser. The current code is wrong, the new code matches the spec and there shouldn't be a FIXME. Cf. https://heycam.github.io/webidl/#es-dictionary: `If Type(esDict) is not Undefined, Null or Object, then throw a TypeError.` Cf. https://streams.spec.whatwg.org/#rs-class (that says it is a dictionary parameter). If this code was using WebIDL, we'd be getting correct / standard behavior for free. Created attachment 432702 [details]
Patch
Committed r279472 (239326@main): <https://commits.webkit.org/239326@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 432702 [details]. |