buffer: handle detached ArrayBuffer views - #64504
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #64504 +/- ##
==========================================
- Coverage 90.14% 90.13% -0.01%
==========================================
Files 741 741
Lines 242076 242051 -25
Branches 45558 45543 -15
==========================================
- Hits 218216 218184 -32
- Misses 15385 15398 +13
+ Partials 8475 8469 -6
🚀 New features to boost your workflow:
|
jasnell
requested changes
Jul 15, 2026
jasnell
left a comment
Member
There was a problem hiding this comment.
As mentioned in the thread, I'd actually rather we went the other direction to treat detached just as zero-length with these.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
Treat detached ArrayBuffers and Buffer or TypedArray views backed by them as zero-length inputs in buffer.isUtf8() and buffer.isAscii(). Both functions now return true for these inputs, consistent with other empty inputs. Signed-off-by: Archkon <180910180+Archkon@users.noreply.github.com>
This comment was marked as spam.
This comment was marked as spam.
Member
|
@Archkon ... please keep in mind that folks in the project are volunteers that are often quite busy. Pinging every couple of days for review is a bit rude. An occasional ping once in a while is fine but three pings within a week is excessive. |
jasnell
approved these changes
Jul 23, 2026
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
Collaborator
This comment was marked as spam.
This comment was marked as spam.
Collaborator
|
Landed in 6bab948 |
aduh95
pushed a commit
that referenced
this pull request
Aug 13, 2026
Treat detached ArrayBuffers and Buffer or TypedArray views backed by them as zero-length inputs in buffer.isUtf8() and buffer.isAscii(). Both functions now return true for these inputs, consistent with other empty inputs. Signed-off-by: Archkon <180910180+Archkon@users.noreply.github.com> PR-URL: #64504 Fixes: #64503 Reviewed-By: James M Snell <jasnell@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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: #64503