Skip to content

feature: allow reading into a 0-length array#3329

Merged
ry merged 4 commits into
denoland:masterfrom
qexk:feature/read-empty-array
Dec 28, 2019
Merged

feature: allow reading into a 0-length array#3329
ry merged 4 commits into
denoland:masterfrom
qexk:feature/read-empty-array

Conversation

@qexk

@qexk qexk commented Nov 13, 2019

Copy link
Copy Markdown
Contributor

Fixes #3287
The Deno read* functions can now return 0 if the supplied buffer has no size. This doesn’t change the previous behaviour, it just adds a new return value.
I wrote one test in readNullBufferFailure in /cli/js/files_test.ts, but if you think it is useless or in the wrong function you can drop the second commit.

qexk added 2 commits November 13, 2019 09:46
Fix #3287.
Mimic POSIX read() behaviour: if there is no bytes to read, return 0 and
do nothing.
Document the new behaviour.
@CLAassistant

CLAassistant commented Nov 13, 2019

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@bartlomieju
bartlomieju requested a review from ry December 28, 2019 13:44

@ry ry 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.

LGTM

@ry
ry merged commit 4d4908d into denoland:master Dec 28, 2019
@qexk
qexk deleted the feature/read-empty-array branch December 28, 2019 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Allow reading into a 0-length array

4 participants