@@ -642,6 +642,10 @@ It can be constructed in a variety of ways.
642642<!-- YAML
643643added: v5.10.0
644644changes:
645+ - version: v20.0.0
646+ pr-url: https://github.com/nodejs/node/pull/45796
647+ description: Throw ERR_INVALID_ARG_TYPE or ERR_OUT_OF_RANGE instead of
648+ ERR_INVALID_ARG_VALUE for invalid input arguments.
645649 - version: v15.0.0
646650 pr-url: https://github.com/nodejs/node/pull/34682
647651 description: Throw ERR_INVALID_ARG_VALUE instead of ERR_INVALID_OPT_VALUE
@@ -688,7 +692,7 @@ console.log(buf);
688692```
689693
690694If ` size ` is larger than
691- [ ` buffer.constants.MAX_LENGTH ` ] [ ] or smaller than 0, [ ` ERR_INVALID_ARG_VALUE ` ] [ ]
695+ [ ` buffer.constants.MAX_LENGTH ` ] [ ] or smaller than 0, [ ` ERR_OUT_OF_RANGE ` ] [ ]
692696is thrown.
693697
694698If ` fill ` is specified, the allocated ` Buffer ` will be initialized by calling
@@ -745,6 +749,10 @@ A `TypeError` will be thrown if `size` is not a number.
745749<!-- YAML
746750added: v5.10.0
747751changes:
752+ - version: v20.0.0
753+ pr-url: https://github.com/nodejs/node/pull/45796
754+ description: Throw ERR_INVALID_ARG_TYPE or ERR_OUT_OF_RANGE instead of
755+ ERR_INVALID_ARG_VALUE for invalid input arguments.
748756 - version: v15.0.0
749757 pr-url: https://github.com/nodejs/node/pull/34682
750758 description: Throw ERR_INVALID_ARG_VALUE instead of ERR_INVALID_OPT_VALUE
@@ -757,7 +765,7 @@ changes:
757765* ` size ` {integer} The desired length of the new ` Buffer ` .
758766
759767Allocates a new ` Buffer ` of ` size ` bytes. If ` size ` is larger than
760- [ ` buffer.constants.MAX_LENGTH ` ] [ ] or smaller than 0, [ ` ERR_INVALID_ARG_VALUE ` ] [ ]
768+ [ ` buffer.constants.MAX_LENGTH ` ] [ ] or smaller than 0, [ ` ERR_OUT_OF_RANGE ` ] [ ]
761769is thrown.
762770
763771The underlying memory for ` Buffer ` instances created in this way is _ not
@@ -815,6 +823,10 @@ additional performance that [`Buffer.allocUnsafe()`][] provides.
815823<!-- YAML
816824added: v5.12.0
817825changes:
826+ - version: v20.0.0
827+ pr-url: https://github.com/nodejs/node/pull/45796
828+ description: Throw ERR_INVALID_ARG_TYPE or ERR_OUT_OF_RANGE instead of
829+ ERR_INVALID_ARG_VALUE for invalid input arguments.
818830 - version: v15.0.0
819831 pr-url: https://github.com/nodejs/node/pull/34682
820832 description: Throw ERR_INVALID_ARG_VALUE instead of ERR_INVALID_OPT_VALUE
@@ -824,7 +836,7 @@ changes:
824836* ` size ` {integer} The desired length of the new ` Buffer ` .
825837
826838Allocates a new ` Buffer ` of ` size ` bytes. If ` size ` is larger than
827- [ ` buffer.constants.MAX_LENGTH ` ] [ ] or smaller than 0, [ ` ERR_INVALID_ARG_VALUE ` ] [ ]
839+ [ ` buffer.constants.MAX_LENGTH ` ] [ ] or smaller than 0, [ ` ERR_OUT_OF_RANGE ` ] [ ]
828840is thrown. A zero-length ` Buffer ` is created if ` size ` is 0.
829841
830842The underlying memory for ` Buffer ` instances created in this way is _ not
@@ -5465,7 +5477,6 @@ introducing security vulnerabilities into an application.
54655477[ `Buffer.from(string)` ] : #static-method-bufferfromstring-encoding
54665478[ `Buffer.poolSize` ] : #class-property-bufferpoolsize
54675479[ `DataView` ] : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView
5468- [ `ERR_INVALID_ARG_VALUE` ] : errors.md#err_invalid_arg_value
54695480[ `ERR_INVALID_BUFFER_SIZE` ] : errors.md#err_invalid_buffer_size
54705481[ `ERR_OUT_OF_RANGE` ] : errors.md#err_out_of_range
54715482[ `File` ] : https://developer.mozilla.org/en-US/docs/Web/API/File
0 commit comments