@@ -644,6 +644,10 @@ It can be constructed in a variety of ways.
644644<!-- YAML
645645added: v5.10.0
646646changes:
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
692696If ` 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 ` ] [ ]
694698is thrown.
695699
696700If ` 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
748752added: v5.10.0
749753changes:
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
761769Allocates 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 ` ] [ ]
763771is thrown.
764772
765773The underlying memory for ` Buffer ` instances created in this way is _ not
@@ -817,6 +825,10 @@ additional performance that [`Buffer.allocUnsafe()`][] provides.
817825<!-- YAML
818826added: v5.12.0
819827changes:
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
828840Allocates 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 ` ] [ ]
830842is thrown. A zero-length ` Buffer ` is created if ` size ` is 0.
831843
832844The 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