Skip to content

fs: improve argument handling for ReadStream#19898

Closed
ryzokuken wants to merge 26 commits intonodejs:masterfrom
ryzokuken:feature/create-read-stream
Closed

fs: improve argument handling for ReadStream#19898
ryzokuken wants to merge 26 commits intonodejs:masterfrom
ryzokuken:feature/create-read-stream

Conversation

@ryzokuken
Copy link
Contributor

Improve handling of erratic arguments in fs.ReadStream

Refs: #19732

For the uninitiated, a summary of what I'm planning to change:

Type Current Behavior Proposed Behavior
undefined (0, Infinity) (0, Infinity)
Anything other than Number ERR_INVALID_ARG_TYPE ERR_INVALID_ARG_TYPE
NaN ERR_INVALID_ARG_TYPE ERR_OUT_OF_RANGE
Negative Numbers ERR_OUT_OF_RANGE
Fractional Numbers Math.round
Integers Work Perfectly Still work perfectly
Invalid Arguments ERR_OUT_OF_RANGE ERR_OUT_OF_RANGE
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

cc @addaleax @anliting @nodejs/fs

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fs Issues and PRs related to the fs subsystem / file system. semver-major PRs that contain breaking changes and should be released in the next major version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.