-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
fix(node/fs): Use correct offset and length in node:fs.read and write #25049
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a test would be good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes Look good. Should this have a test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
My fix in #25030 was buggy, I forgot to pass the
byteOffset
andbyteLength
. Whoops.I also discovered that fs.read was not respecting the
offset
argument, and we were constructing a newBuffer
for the callback instead of just passing the original one (which is what node does, and the @types/node definitions also indicate the callback should get the same type).Fixes #25028.