X Tutup
The Wayback Machine - https://web.archive.org/web/20210814015649/https://github.com/nodejs/node/pull/37750
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

@cactysman cactysman commented Mar 14, 2021

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'
}
lib/internal/buffer.js Outdated Show resolved Hide resolved
Copy link
Contributor

@cjihrig cjihrig left a comment

LGTM with the linter issue resolved.

@cactysman
Copy link
Contributor Author

@cactysman cactysman commented Mar 14, 2021

LGTM with the linter issue resolved.

Can we squash the commit?

@Trott
Trott approved these changes Mar 14, 2021
@lpinca
lpinca approved these changes Mar 15, 2021
@guybedford guybedford force-pushed the nodejs:master branch from dc5a5da to 8e46568 Mar 29, 2021
@nodejs-github-bot

This comment has been hidden.

@jasnell
jasnell approved these changes Apr 6, 2021
@nodejs-github-bot

This comment has been hidden.

@nodejs-github-bot

This comment has been hidden.

@jasnell jasnell removed the needs-ci label Apr 14, 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>
@aduh95
Copy link
Contributor

@aduh95 aduh95 commented Apr 17, 2021

Landed in 14aed60. Thanks for the contribution :)

@aduh95 aduh95 merged commit 14aed60 into nodejs:master Apr 17, 2021
16 checks passed
16 checks passed
@github-actions
build-tarball
Details
@github-actions
build-windows
Details
@github-actions
coverage-linux
Details
@github-actions
coverage-windows
Details
@github-actions
lint-addon-docs
Details
@github-actions
build-docs
Details
@github-actions
test-asan
Details
@github-actions
test-linux
Details
@github-actions
test-macOS
Details
@github-actions
lint-cpp
Details
@github-actions
lint-md
Details
@github-actions
lint-js
Details
@github-actions
lint-py
Details
@github-actions
lint-sh
Details
@github-actions
lint-codeowners
Details
@github-actions
lint-pr-url
Details
@cactysman cactysman deleted the cactysman:fix-buffer-bigint-range-literal branch Apr 17, 2021
targos added 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 added 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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

X Tutup