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,errors: add missing n literal in range error string #37750

Merged
merged 1 commit into from Apr 17, 2021
Merged

buffer,errors: add missing n literal in range error string #37750

merged 1 commit into from Apr 17, 2021

Conversation

cactysman
Copy link
Contributor

This adds the missing n literal for BigInt range errors in buffers.

Here's an example from the REPL with arrows pointing at where the n literal is missing.

> const buffer = Buffer.alloc(1024)
undefined
> buffer.writeBigInt64BE(2n ** 64n)
Uncaught:
RangeError [ERR_OUT_OF_RANGE]: The value of "value" is out of range. It must be >= -(2n ** 63n) and < 2 ** 63n. Received 18_446_744_073_709_551_616n
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>^
    at checkInt (internal/buffer.js:67:11)
    at writeBigU_Int64BE (internal/buffer.js:600:3)
    at Buffer.writeBigInt64BE (internal/buffer.js:631:10)
    at repl:1:8
    at Script.runInThisContext (vm.js:132:18)
    at REPLServer.defaultEval (repl.js:472:29)
    at bound (domain.js:430:14)
    at REPLServer.runBound [as eval] (domain.js:443:12)
    at REPLServer.onLine (repl.js:794:10)
    at REPLServer.emit (events.js:326:22) {
  code: 'ERR_OUT_OF_RANGE'
}

@nodejs-github-bot nodejs-github-bot added buffer Issues and PRs related to the buffer subsystem. needs-ci PRs that need a full CI run. labels Mar 14, 2021
lib/internal/buffer.js Outdated Show resolved Hide resolved
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 with the linter issue resolved.

@cactysman
Copy link
Contributor Author

LGTM with the linter issue resolved.

Can we squash the commit?

@PoojaDurgad PoojaDurgad added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 5, 2021
@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

@jasnell jasnell removed the needs-ci PRs that need a full CI run. label Apr 14, 2021
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

PR-URL: #37750
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Pooja D P <Pooja.D.P@ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@aduh95
Copy link
Contributor

aduh95 commented Apr 17, 2021

Landed in 14aed60. Thanks for the contribution :)

@aduh95 aduh95 merged commit 14aed60 into nodejs:master Apr 17, 2021
@cactysman cactysman deleted the fix-buffer-bigint-range-literal branch April 17, 2021 17:40
targos pushed a commit that referenced this pull request May 1, 2021
PR-URL: #37750
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Pooja D P <Pooja.D.P@ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@danielleadams danielleadams mentioned this pull request May 3, 2021
danielleadams pushed a commit that referenced this pull request May 8, 2021
PR-URL: #37750
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Pooja D P <Pooja.D.P@ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. buffer Issues and PRs related to the buffer subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet