Skip to content

Conversation

@sungpaks
Copy link
Contributor

Resolved TODO to use more proper error code
INVALID_ARG_TYPE -> INVALID_ARG_VALUE, it seems better
Additionally, when the list argument has null or undefined and the length argument is undefined, it causes TypeError: Cannot read properties error.
It has been adjusted to be handled by the INVALID_ARG_VALUE error.
And, reflected this changes to tests

Refs: #19445

Resolved TODO to use more proper error code
INVALID_ARG_TYPE -> INVALID_ARG_VALUE, it seems better
Additionally, when the `list` argument has null or undefined and
the `length` argument is undefined, it causes
`TypeError: Cannot read properties` error.
It has been adjusted to be handled by the INVALID_ARG_VALUE error.

Refs: nodejs#19445
@nodejs-github-bot nodejs-github-bot added buffer Issues and PRs related to the buffer subsystem. needs-ci PRs that need a full CI run. labels Aug 20, 2024
@codecov
Copy link

codecov bot commented Aug 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.31%. Comparing base (ef4bdbf) to head (2fce9d6).
Report is 71 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #54464      +/-   ##
==========================================
- Coverage   87.32%   87.31%   -0.01%     
==========================================
  Files         648      648              
  Lines      182383   182381       -2     
  Branches    34991    34986       -5     
==========================================
- Hits       159260   159253       -7     
- Misses      16384    16385       +1     
- Partials     6739     6743       +4     
Files with missing lines Coverage Δ
lib/buffer.js 96.69% <100.00%> (-0.01%) ⬇️

... and 27 files with indirect coverage changes

@avivkeller
Copy link
Member

avivkeller commented Aug 20, 2024

I'm not sure if this is a breaking change / needs a CIGTM because it's changing an error emitted from a common function.

@anonrig anonrig added the semver-major PRs that contain breaking changes and should be released in the next major version. label Aug 21, 2024
@sungpaks
Copy link
Contributor Author

/cc @BridgeAR I wonder your opinion, I'm hesitating if it is the right way to resolve the TODO like this.

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

Labels

buffer Issues and PRs related to the buffer subsystem. needs-ci PRs that need a full CI run. 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.

4 participants