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#slice incorrectly handles the start = end = 0 case #960

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

Buffer#slice incorrectly handles the start = end = 0 case #960

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

Comments

@SheetJSDev
Copy link
Contributor

Repro on 0.1.6:

console.log(new Buffer(3).slice(0,0).length);

Node prints 0 while Bun prints 3. When start and end are equal, it should be returning a zero-length Buffer.

@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