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: fix backwards incompatibility #12439

Closed

Conversation

mscdex
Copy link
Contributor

@mscdex mscdex commented Apr 16, 2017

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), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)
  • buffer

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.
@mscdex mscdex added the buffer Issues and PRs related to the buffer subsystem. label Apr 16, 2017
Copy link
Contributor

@cjihrig cjihrig left a 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?

@Trott
Copy link
Member

Trott commented Apr 16, 2017

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

Copy link
Member

@Trott Trott left a 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.

@mscdex
Copy link
Contributor Author

mscdex commented Apr 16, 2017

@cjihrig I prefer to include parens when using conditionals outside of an if, while, for, etc. so that they're easier to spot visually and the intention is clear. Also it's consistent with the style of the code that was already merged.

jasnell pushed a commit that referenced this pull request Apr 18, 2017
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 <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@jasnell
Copy link
Member

jasnell commented Apr 18, 2017

Landed in 7cd0d4f

@jasnell jasnell closed this Apr 18, 2017
@mscdex mscdex deleted the buffer-perf-fix-backwards-compat branch May 15, 2017 20:39
@jasnell jasnell mentioned this pull request May 11, 2017
@gibfahn gibfahn mentioned this pull request Jun 15, 2017
3 tasks
@gibfahn gibfahn added the baking-for-lts PRs that need to wait before landing in a LTS release. label Jun 18, 2017
@gibfahn
Copy link
Member

gibfahn commented Jun 18, 2017

Depends on #12361.

@MylesBorins MylesBorins added dont-land-on-v6.x and removed baking-for-lts PRs that need to wait before landing in a LTS release. labels Dec 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
buffer Issues and PRs related to the buffer subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants