@@ -644,6 +644,10 @@ It can be constructed in a variety of ways.
644
644
<!-- YAML
645
645
added: v5.10.0
646
646
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.
647
651
- version: v15.0.0
648
652
pr-url: https://github.com/nodejs/node/pull/34682
649
653
description: Throw ERR_INVALID_ARG_VALUE instead of ERR_INVALID_OPT_VALUE
@@ -690,7 +694,7 @@ console.log(buf);
690
694
```
691
695
692
696
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 ` ] [ ]
694
698
is thrown.
695
699
696
700
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.
747
751
<!-- YAML
748
752
added: v5.10.0
749
753
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.
750
758
- version: v15.0.0
751
759
pr-url: https://github.com/nodejs/node/pull/34682
752
760
description: Throw ERR_INVALID_ARG_VALUE instead of ERR_INVALID_OPT_VALUE
@@ -759,7 +767,7 @@ changes:
759
767
* ` size ` {integer} The desired length of the new ` Buffer ` .
760
768
761
769
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 ` ] [ ]
763
771
is thrown.
764
772
765
773
The underlying memory for ` Buffer ` instances created in this way is _ not
@@ -817,6 +825,10 @@ additional performance that [`Buffer.allocUnsafe()`][] provides.
817
825
<!-- YAML
818
826
added: v5.12.0
819
827
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.
820
832
- version: v15.0.0
821
833
pr-url: https://github.com/nodejs/node/pull/34682
822
834
description: Throw ERR_INVALID_ARG_VALUE instead of ERR_INVALID_OPT_VALUE
@@ -826,7 +838,7 @@ changes:
826
838
* ` size ` {integer} The desired length of the new ` Buffer ` .
827
839
828
840
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 ` ] [ ]
830
842
is thrown. A zero-length ` Buffer ` is created if ` size ` is 0.
831
843
832
844
The underlying memory for ` Buffer ` instances created in this way is _ not
@@ -5485,7 +5497,6 @@ introducing security vulnerabilities into an application.
5485
5497
[ `Buffer.from(string)` ] : #static-method-bufferfromstring-encoding
5486
5498
[ `Buffer.poolSize` ] : #class-property-bufferpoolsize
5487
5499
[ `DataView` ] : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView
5488
- [ `ERR_INVALID_ARG_VALUE` ] : errors.md#err_invalid_arg_value
5489
5500
[ `ERR_INVALID_BUFFER_SIZE` ] : errors.md#err_invalid_buffer_size
5490
5501
[ `ERR_OUT_OF_RANGE` ] : errors.md#err_out_of_range
5491
5502
[ `File` ] : https://developer.mozilla.org/en-US/docs/Web/API/File
0 commit comments