Repository navigation
buffer: fix fill ignoring explicit end when offset is undefined - #67696
archidoge0 wants to merge 1 commit into
Conversation
Refs: nodejs#67574 Signed-off-by: archidoge0 <157263272+archidoge0@users.noreply.github.com>
|
Welcome to Node.js, and thank you for your first contribution! Before review, please take a moment to read:
Please make sure every commit is signed off. For a first pull request, GitHub Actions require collaborator approval and Jenkins CI must be started by a collaborator or triager, so an initial wait is normal. |
|
Thank you for the PR! I previously closed these issues in bulk, but it would be helpful if you could reopen the corresponding issue when opening a PR. Also, if the PR resolves an issue, please include a closing reference such as |
It's not possible for a user to re-open an issue that was closed by a moderator. You've already re-opened #67574 I see.
The Node.js process uses |
|
@MikeMcC399 Thanks for clarifying! I hadn’t realized that issue authors can’t reopen an issue closed by a maintainer without the necessary repository permissions. Sorry for the confusion. GitHub does support Closes:, but I agree that sticking to Fixes: is clearer and consistent with the Node.js guidelines. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #67696 +/- ##
==========================================
- Coverage 90.60% 90.59% -0.02%
==========================================
Files 801 801
Lines 280972 281088 +116
Branches 54230 54265 +35
==========================================
+ Hits 254583 254645 +62
- Misses 16566 16630 +64
+ Partials 9823 9813 -10
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the Buffer.fill() fix that preserves explicit end bounds when the offset is undefined.
No open issues 🎉
What changed in this PR
Fixes Buffer.fill() so an undefined offset defaults to zero without discarding an explicitly supplied end, addressing #67574.
Changes:
- Defaults and validates offset and end independently, preserving explicit end bounds.
- Adds regression tests for numeric, string, Buffer, and encoded-string fills, plus zero and out-of-range end values.
| File | Description |
|---|---|
test/parallel/test-buffer-fill.js |
Tests explicit end handling when offset is undefined. |
lib/buffer.js |
Separates offset and end defaulting and applies end validation consistently. |
Review effort: Balanced
This comment was marked as off-topic.
This comment was marked as off-topic.
|
Thanks, Mike, and sorry for the confusion. Just for reference, the v7.8.0 parser accepts |
|
I guess I didn't check properly, so thanks for putting me right. This is getting a little off-topic for the PR here, but maybe you'd like to suggest a documentation change? It should at least say that Closes / Resolved are accepted, even if Fixes is preferred. |
Fix this issue as my first PR
Fixes: #67574
Also refs: #67572, thanks for your guidance @MikeMcC399 and @inoway46.