-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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: allow .write() offset to be at buffer end #8154
Conversation
Do not throw if the offset passed to `buf.write()` points to the end of the buffer. Fixes: nodejs#8127
Given that this removes a throw, we need to decide if it's semver-major or not. I think it's likely safe as a patch. The change itself LGTM if CI is green |
This came up as an unintended regression in v6.4.0, so yeah, definitely +1 for considering this a semver-patch one. |
Windows fanned test builds were having Jenkins problems. Re-running CI: https://ci.nodejs.org/job/node-test-pull-request/3721/ |
@@ -358,6 +358,9 @@ writeTest.write('e', 3, 'ascii'); | |||
writeTest.write('j', 4, 'ascii'); | |||
assert.equal(writeTest.toString(), 'nodejs'); | |||
|
|||
// Does not throw (see https://github.com/nodejs/node/issues/8127). | |||
Buffer.alloc(1).write('', 1, 0); |
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.
Could you put this in an assert.doesNotThrow()
?
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.
@cjihrig Done!
LGTM |
This is definitely a semver-patch, because it reverts a breaking change that was accidentally introduce in a semver-minor version. |
Still LGTM. Just to be unnecessarily-extra-cautious, should probably do one more CI run following the new commit but I'm good with it landing either way. |
CI: https://ci.nodejs.org/job/node-test-commit/4646/ … because running again on the latest changes is probably just the right amount of cautious ;) |
LGTM |
Landed in 3242b27! |
Notable changes: * **buffer**: Fix regression introduced in v6.4.0 that prevented .write() at buffer end (Anna Henningsen) #8154 * **inspector**: * fix inspector hang while disconnecting (Aleksei Koziatinskii) #8021 * add support for uncaught exception (Aleksei Koziatinskii) #8043 * **meta**: add @joshgav to collaborators (Josh Gavant) #8146 * **repl**: Fix saving editor mode text in `.save` (Prince J Wesley) #8145 * ***Revert*** "**repl,util**: insert carriage returns in output" (Evan Lucas) #8143
Notable changes: * **buffer**: Fix regression introduced in v6.4.0 that prevented .write() at buffer end (Anna Henningsen) #8154 * **deps**: update V8 to 5.1.281.75 (Ali Ijaz Sheikh) #8054 * **inspector**: * fix inspector hang while disconnecting (Aleksei Koziatinskii) #8021 * add support for uncaught exception (Aleksei Koziatinskii) #8043 * **repl**: Fix saving editor mode text in `.save` (Prince J Wesley) #8145 * ***Revert*** "**repl,util**: insert carriage returns in output" (Evan Lucas) #8143 PR-URL: #8253
Notable changes: * **buffer**: Fix regression introduced in v6.4.0 that prevented .write() at buffer end (Anna Henningsen) #8154 * **deps**: update V8 to 5.1.281.75 (Ali Ijaz Sheikh) #8054 * **inspector**: * fix inspector hang while disconnecting (Aleksei Koziatinskii) #8021 * add support for uncaught exception (Aleksei Koziatinskii) #8043 * **repl**: Fix saving editor mode text in `.save` (Prince J Wesley) #8145 * ***Revert*** "**repl,util**: insert carriage returns in output" (Evan Lucas) #8143 PR-URL: #8253
Node.js 6.4.0 was shipped with a bug in it's Buffer implementation that causes the tedious test cases to fail. See #431, nodejs/node#8127 and nodejs/node#8154.
Notable changes: * **buffer**: Fix regression introduced in v6.4.0 that prevented .write() at buffer end (Anna Henningsen) #8154 * **deps**: update V8 to 5.1.281.75 (Ali Ijaz Sheikh) #8054 * **inspector**: * fix inspector hang while disconnecting (Aleksei Koziatinskii) #8021 * add support for uncaught exception (Aleksei Koziatinskii) #8043 * **repl**: Fix saving editor mode text in `.save` (Prince J Wesley) #8145 * ***Revert*** "**repl,util**: insert carriage returns in output" (Evan Lucas) #8143 PR-URL: #8253
Node.js 6.4.0 was shipped with a bug in it's Buffer implementation that causes the tedious test cases to fail. See tediousjs#431, nodejs/node#8127 and nodejs/node#8154.
@addaleax should this be backported? |
It depends on/fixes a problem with #7494, so, probably not… although I can’t quite see why that one landed as |
Checklist
make -j4 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
buffer
Description of change
Do not throw if the offset passed to
buf.write()
points to the end of the buffer.Fixes: #8127
CI: https://ci.nodejs.org/job/node-test-commit/4633/