FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

streams: add null check in Readable.from by rexagod · Pull Request #32873 · nodejs/node · GitHub

/ node Public

streams: add null check in Readable.from - #32873

Closed
rexagod wants to merge 1 commit into
nodejs:masterfrom
rexagod:i-32845
Closed

streams: add null check in Readable.from#32873
rexagod wants to merge 1 commit into
nodejs:masterfrom
rexagod:i-32845

Conversation

rexagod commented Apr 16, 2020
edited
Loading

Copy link
Copy Markdown
Member

Throws ERR_STREAM_NULL_VALUES error if a null value is passed to
Readable.from. Also added docs for the same.

Fixes: #32845

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests added
  • documentation is changed or added
  • commit message follows commit guidelines

himself65 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Test needed

Comment thread lib/internal/streams/from.js Outdated
Comment thread lib/internal/streams/from.js Outdated

rexagod commented Apr 26, 2020

Copy link
Copy Markdown
Member Author

ping @addaleax @himself65

Copy link
Copy Markdown
Member

@rexagod This LGTM but it looks like this needs to be rebased against master to resolve merge conflicts.

Comment thread lib/internal/streams/from.js Outdated
} else {
reading = false;
const res = await value;
if (res == null) throw new ERR_STREAM_NULL_VALUES();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I'm not sure I agree with this throwing. There is no way to catch this? I think it should do readable.destroy(new ERR_STREAM_NULL_VALUES()). @lpinca Thoughts?

ronag commented Apr 27, 2020

Copy link
Copy Markdown
Member

@nodejs/streams

ronag added the stream Issues and PRs related to the stream subsystem. label Apr 27, 2020
Comment thread lib/internal/streams/from.js Outdated
himself65 dismissed their stale review April 27, 2020 09:30

no changes request

Comment thread doc/api/stream.md Outdated
Comment thread lib/internal/streams/from.js Outdated

ronag commented Apr 27, 2020
edited
Loading

Copy link
Copy Markdown
Member

I would like @lpinca's feedback here on whether we throw err or destroy(err).

mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

lgtm

Copy link
Copy Markdown
Collaborator

Comment thread lib/internal/streams/from.js Outdated

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

ronag added the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Apr 27, 2020
addaleax removed the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Apr 27, 2020

Copy link
Copy Markdown
Member

@rexagod Looks like a merge commit somehow got in here, can you rebase this against master?

Throws `ERR_STREAM_NULL_VALUES` error if a null value is passed to
`Readable.from`. Also added docs for the same.

Fixes: nodejs#32845

resolve recieved value and add test

Update test/parallel/test-stream-readable-next-no-null.js

Co-Authored-By: 扩散性百万甜面包 <himself65@outlook.com>

rebase fix

fixup

fixup: destroy -> throw

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

mcollina pushed a commit that referenced this pull request Apr 29, 2020
Throws `ERR_STREAM_NULL_VALUES` error if a null value is passed to
`Readable.from`. Also added docs for the same.

Co-Authored-By: 扩散性百万甜面包 <himself65@outlook.com>
Fixes: #32845
PR-URL: #32873
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>

Copy link
Copy Markdown
Member

Landed in 2cd7970

mcollina closed this Apr 29, 2020
targos pushed a commit that referenced this pull request May 4, 2020
Throws `ERR_STREAM_NULL_VALUES` error if a null value is passed to
`Readable.from`. Also added docs for the same.

Co-Authored-By: 扩散性百万甜面包 <himself65@outlook.com>
Fixes: #32845
PR-URL: #32873
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
targos mentioned this pull request May 4, 2020
targos pushed a commit that referenced this pull request May 7, 2020
Throws `ERR_STREAM_NULL_VALUES` error if a null value is passed to
`Readable.from`. Also added docs for the same.

Co-Authored-By: 扩散性百万甜面包 <himself65@outlook.com>
Fixes: #32845
PR-URL: #32873
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
targos pushed a commit that referenced this pull request May 13, 2020
Throws `ERR_STREAM_NULL_VALUES` error if a null value is passed to
`Readable.from`. Also added docs for the same.

Co-Authored-By: 扩散性百万甜面包 <himself65@outlook.com>
Fixes: #32845
PR-URL: #32873
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stream Issues and PRs related to the stream subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stream: Readable.from with null

7 participants


Back | FazBrowse Home | New Git URL