Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9101630

Browse filesBrowse files
deokjinkimtargos
authored andcommitted
doc: update error code of buffer
According to use of `validateNumber`, error code is changed from ERR_INVALID_ARG_VALUE to ERR_OUT_OF_RANGE. Refs: #45796 PR-URL: #47617 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent b8927dd commit 9101630
Copy full SHA for 9101630

File tree

Expand file treeCollapse file tree

1 file changed

+15
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+15
-4
lines changed
Open diff view settings
Collapse file

‎doc/api/buffer.md‎

Copy file name to clipboardExpand all lines: doc/api/buffer.md
+15-4Lines changed: 15 additions & 4 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,10 @@ It can be constructed in a variety of ways.
644644
<!-- YAML
645645
added: v5.10.0
646646
changes:
647+
- version: v20.0.0
648+
pr-url: https://github.com/nodejs/node/pull/45796
649+
description: Throw ERR_INVALID_ARG_TYPE or ERR_OUT_OF_RANGE instead of
650+
ERR_INVALID_ARG_VALUE for invalid input arguments.
647651
- version: v15.0.0
648652
pr-url: https://github.com/nodejs/node/pull/34682
649653
description: Throw ERR_INVALID_ARG_VALUE instead of ERR_INVALID_OPT_VALUE
@@ -690,7 +694,7 @@ console.log(buf);
690694
```
691695

692696
If `size` is larger than
693-
[`buffer.constants.MAX_LENGTH`][] or smaller than 0, [`ERR_INVALID_ARG_VALUE`][]
697+
[`buffer.constants.MAX_LENGTH`][] or smaller than 0, [`ERR_OUT_OF_RANGE`][]
694698
is thrown.
695699

696700
If `fill` is specified, the allocated `Buffer` will be initialized by calling
@@ -747,6 +751,10 @@ A `TypeError` will be thrown if `size` is not a number.
747751
<!-- YAML
748752
added: v5.10.0
749753
changes:
754+
- version: v20.0.0
755+
pr-url: https://github.com/nodejs/node/pull/45796
756+
description: Throw ERR_INVALID_ARG_TYPE or ERR_OUT_OF_RANGE instead of
757+
ERR_INVALID_ARG_VALUE for invalid input arguments.
750758
- version: v15.0.0
751759
pr-url: https://github.com/nodejs/node/pull/34682
752760
description: Throw ERR_INVALID_ARG_VALUE instead of ERR_INVALID_OPT_VALUE
@@ -759,7 +767,7 @@ changes:
759767
* `size` {integer} The desired length of the new `Buffer`.
760768

761769
Allocates a new `Buffer` of `size` bytes. If `size` is larger than
762-
[`buffer.constants.MAX_LENGTH`][] or smaller than 0, [`ERR_INVALID_ARG_VALUE`][]
770+
[`buffer.constants.MAX_LENGTH`][] or smaller than 0, [`ERR_OUT_OF_RANGE`][]
763771
is thrown.
764772

765773
The underlying memory for `Buffer` instances created in this way is _not
@@ -817,6 +825,10 @@ additional performance that [`Buffer.allocUnsafe()`][] provides.
817825
<!-- YAML
818826
added: v5.12.0
819827
changes:
828+
- version: v20.0.0
829+
pr-url: https://github.com/nodejs/node/pull/45796
830+
description: Throw ERR_INVALID_ARG_TYPE or ERR_OUT_OF_RANGE instead of
831+
ERR_INVALID_ARG_VALUE for invalid input arguments.
820832
- version: v15.0.0
821833
pr-url: https://github.com/nodejs/node/pull/34682
822834
description: Throw ERR_INVALID_ARG_VALUE instead of ERR_INVALID_OPT_VALUE
@@ -826,7 +838,7 @@ changes:
826838
* `size` {integer} The desired length of the new `Buffer`.
827839

828840
Allocates a new `Buffer` of `size` bytes. If `size` is larger than
829-
[`buffer.constants.MAX_LENGTH`][] or smaller than 0, [`ERR_INVALID_ARG_VALUE`][]
841+
[`buffer.constants.MAX_LENGTH`][] or smaller than 0, [`ERR_OUT_OF_RANGE`][]
830842
is thrown. A zero-length `Buffer` is created if `size` is 0.
831843

832844
The underlying memory for `Buffer` instances created in this way is _not
@@ -5483,7 +5495,6 @@ introducing security vulnerabilities into an application.
54835495
[`Buffer.from(string)`]: #static-method-bufferfromstring-encoding
54845496
[`Buffer.poolSize`]: #class-property-bufferpoolsize
54855497
[`DataView`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView
5486-
[`ERR_INVALID_ARG_VALUE`]: errors.md#err_invalid_arg_value
54875498
[`ERR_INVALID_BUFFER_SIZE`]: errors.md#err_invalid_buffer_size
54885499
[`ERR_OUT_OF_RANGE`]: errors.md#err_out_of_range
54895500
[`File`]: https://developer.mozilla.org/en-US/docs/Web/API/File

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.