buffer: make methods work on Uint8Array instances · nodejs/node@e9a3426 · GitHub
Skip to content

Commit e9a3426

Browse files
nbbeekenaduh95
authored andcommitted
buffer: make methods work on Uint8Array instances
Removes the reliance on prototype bound methods internally so that Uint8Arrays can be set as the bound `this` value when calling the various Buffer methods. Introduces some additional tamper protection by removing internal reliance on writable properties. Fixes: #56577 PR-URL: #56578 Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent 8dd379d commit e9a3426

8 files changed

Lines changed: 1337 additions & 156 deletions

File tree

doc/api/buffer.md

Lines changed: 41 additions & 0 deletions

lib/buffer.js

Lines changed: 37 additions & 24 deletions

0 commit comments

Comments
 (0)