GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||
GeezerVison is showing github.com — buffer: throw on write() to immutable buffers by vedchaudhari · Pull Request #67741 · nodejs/node Conversation
Contributor
// node --js-immutable-arraybuffer const buf = Buffer.from(new Uint8Array([1, 2, 3, 4]).buffer.transferToImmutable()); buf.write('hi'); console.log(buf); // <Buffer 68 69 03 04>
This adds the check to the three native write paths, including the fast API one, and throws
Refs: #66346 Assisted-by: an AI coding agent. Reviewed and tested locally by me.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
|
There was an error while loading. Please reload this page.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@ ## main #67741 +/- ## ========================================== - Coverage 92.59% 90.50% -2.10% ========================================== Files 433 805 +372 Lines 200382 285818 +85436 Branches 30786 55189 +24403 ========================================== + Hits 185553 258685 +73132 - Misses 14486 17219 +2733 - Partials 343 9914 +9571
🚀 New features to boost your workflow:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
You'll probably want to rebase this after #67733 lands |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
buf.write() could change the bytes of a buffer backed by an immutable ArrayBuffer. Throw ERR_INVALID_ARG_VALUE instead, like other APIs already do. Refs: nodejs#66346 Signed-off-by: vedchaudhari <[email protected]>
2053ed6 to
36f339b
Compare
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.