Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buffer#copy misinterpreting arguments #962

Closed
SheetJSDev opened this issue Aug 2, 2022 · 0 comments · Fixed by #1113
Closed

Buffer#copy misinterpreting arguments #962

SheetJSDev opened this issue Aug 2, 2022 · 0 comments · Fixed by #1113
Labels
node.js Compatibility with Node.js APIs

Comments

@SheetJSDev
Copy link
Contributor

Repro motivated by NodeJS docs:

const buf1 = Buffer.allocUnsafe(26);
const buf2 = Buffer.allocUnsafe(26).fill('!'.charCodeAt(0));
for (let i = 0; i < 26; i++) buf1[i] = i + 97;
buf1.copy(buf2, 8, 16, 20);
console.log(buf2[9]);

Node prints 114, Bun prints 118

@Jarred-Sumner Jarred-Sumner added the node.js Compatibility with Node.js APIs label Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
node.js Compatibility with Node.js APIs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants