IsReadableStream() and IsWritableStream() throw on undefined values |
||||
Issue description
ReadableStream.prototype.getReader.call(undefined) and
WritableStream.prototype.getWriter.call(undefined)
throw an exception like this:
VM428:1 Uncaught TypeError: Cannot convert undefined or null to object
at hasOwnProperty (<anonymous>)
at <anonymous>:1:36
(anonymous) @ VM428:1
While this is technically correct, the message is not helpful.
,
Jul 24 2017
The Is*Stream() methods should never throw.
,
Jul 26 2017
Issue 671571 has been merged into this issue.
,
Jul 26 2017
,
Jul 28 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/be92b2dad8a80e32931659b3cac1d2e059baf623 commit be92b2dad8a80e32931659b3cac1d2e059baf623 Author: Adam Rice <ricea@chromium.org> Date: Fri Jul 28 13:07:18 2017 Stop IsReadableStream* and IsWritableStream* throwing Previously IsReadableStream, IsReadableStreamDefaultWriter, IsReadableStreamDefaultController, IsWritableStream, IsWritableStreamDefaultWriter and IsWritableStreamDefaultController would throw when passed a null or undefined value. Make them return false instead. Also add CommonOperations.js file. Currently it only contains the function hasOwnPropertyNoThrow() but more will be added later. TBR=brettw@chromium.org Bug: 747772 Change-Id: I06aa2c92de994d547c875c20d54fd50c0551662a Reviewed-on: https://chromium-review.googlesource.com/585030 Commit-Queue: Adam Rice <ricea@chromium.org> Reviewed-by: Takeshi Yoshino <tyoshino@chromium.org> Cr-Commit-Position: refs/heads/master@{#490375} [modify] https://crrev.com/be92b2dad8a80e32931659b3cac1d2e059baf623/.gn [add] https://crrev.com/be92b2dad8a80e32931659b3cac1d2e059baf623/third_party/WebKit/Source/core/streams/CommonOperations.js [modify] https://crrev.com/be92b2dad8a80e32931659b3cac1d2e059baf623/third_party/WebKit/Source/core/streams/ReadableStream.js [modify] https://crrev.com/be92b2dad8a80e32931659b3cac1d2e059baf623/third_party/WebKit/Source/core/streams/WritableStream.js
,
Jul 31 2017
|
||||
►
Sign in to add a comment |
||||
Comment 1 by ricea@chromium.org
, Jul 24 2017A more serious issue is that pipeThrough() throws, ie. new ReadableStream().pipeThrough({writable: undefined}) will throw even though pipeThrough() should never throw.