New issue
Advanced search Search tips

Issue 747772 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jul 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

IsReadableStream() and IsWritableStream() throw on undefined values

Project Member Reported by ricea@chromium.org, Jul 24 2017

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.
 

Comment 1 by ricea@chromium.org, Jul 24 2017

A more serious issue is that pipeThrough() throws, ie.

new ReadableStream().pipeThrough({writable: undefined}) will throw even though pipeThrough() should never throw.

Comment 2 by ricea@chromium.org, Jul 24 2017

Summary: IsReadableStream() and IsWritableStream() throw on undefined values (was: IsReadableStream and IsWritableStream() exception message for undefined values could be better)
The Is*Stream() methods should never throw.

Comment 3 by ricea@chromium.org, Jul 26 2017

 Issue 671571  has been merged into this issue.

Comment 4 by ricea@chromium.org, Jul 26 2017

Status: Started (was: Assigned)
Project Member

Comment 5 by bugdroid1@chromium.org, 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

Comment 6 by ricea@chromium.org, Jul 31 2017

Status: Fixed (was: Started)

Sign in to add a comment