-
Notifications
You must be signed in to change notification settings - Fork 30k
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: fix backwards incompatibility #12439
Conversation
4a86803 introduced a backwards incompatibility by accident and was not caught due to an existing test that wasn't strict enough. This commit fixes both the backwards incompatibility and the 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. Can the parens in lib/buffer.js
be dropped though?
I'm not opposed to this, but I want to suggest the possibility that we only want this on v7.x and earlier. I'm not sure it makes a lot of sense to have two different error messages for an invalid encoding, so the accidental removal of one of them in 4a86803 arguably makes the error messages better/more consistent and we might as well do it in 8.x.x and forward. I say "arguably" because you could make the case that the one that specifically says "string" is better, and I suspect someone might make that argument. :-D |
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 if CI is green.
@cjihrig I prefer to include parens when using conditionals outside of an |
4a86803 introduced a backwards incompatibility by accident and was not caught due to an existing test that wasn't strict enough. This commit fixes both the backwards incompatibility and the test. PR-URL: #12439 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Landed in 7cd0d4f |
Depends on #12361. |
4a86803 introduced a backwards incompatibility by accident and was not caught due to an existing test that wasn't strict enough.
This commit fixes both the backwards incompatibility and the test.
This changes does not affect performance.
CI: https://ci.nodejs.org/job/node-test-pull-request/7424/
/cc @Trott
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)