|
27 | 27 | MathFloor, |
28 | 28 | MathMin, |
29 | 29 | MathTrunc, |
| 30 | + NumberIsNaN, |
| 31 | + NumberMAX_SAFE_INTEGER, |
| 32 | + NumberMIN_SAFE_INTEGER, |
30 | 33 | ObjectCreate, |
31 | 34 | ObjectDefineProperties, |
32 | 35 | ObjectDefineProperty, |
@@ -175,9 +178,9 @@ function showFlaggedDeprecation(){ |
175 | 178 |
|
176 | 179 | functiontoInteger(n,defaultVal){ |
177 | 180 | n=+n; |
178 | | -if(!Number.isNaN(n)&& |
179 | | -n>=Number.MIN_SAFE_INTEGER&& |
180 | | -n<=Number.MAX_SAFE_INTEGER){ |
| 181 | +if(!NumberIsNaN(n)&& |
| 182 | +n>=NumberMIN_SAFE_INTEGER&& |
| 183 | +n<=NumberMAX_SAFE_INTEGER){ |
181 | 184 | return((n%1)===0 ? n : MathFloor(n)); |
182 | 185 | } |
183 | 186 | returndefaultVal; |
@@ -442,7 +445,7 @@ function fromArrayBuffer(obj, byteOffset, length){ |
442 | 445 | byteOffset=0; |
443 | 446 | }else{ |
444 | 447 | byteOffset=+byteOffset; |
445 | | -if(Number.isNaN(byteOffset)) |
| 448 | +if(NumberIsNaN(byteOffset)) |
446 | 449 | byteOffset=0; |
447 | 450 | } |
448 | 451 |
|
@@ -890,7 +893,7 @@ function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir){ |
890 | 893 | // Coerce to Number. Values like null and [] become 0. |
891 | 894 | byteOffset=+byteOffset; |
892 | 895 | // If the offset is undefined, "foo",{}, coerces to NaN, search whole buffer. |
893 | | -if(Number.isNaN(byteOffset)){ |
| 896 | +if(NumberIsNaN(byteOffset)){ |
894 | 897 | byteOffset=dir ? 0 : buffer.length; |
895 | 898 | } |
896 | 899 | dir=!!dir;// Cast to bool. |
@@ -1063,7 +1066,7 @@ function adjustOffset(offset, length){ |
1063 | 1066 | if(offset<length){ |
1064 | 1067 | returnoffset; |
1065 | 1068 | } |
1066 | | -returnNumber.isNaN(offset) ? 0 : length; |
| 1069 | +returnNumberIsNaN(offset) ? 0 : length; |
1067 | 1070 | } |
1068 | 1071 |
|
1069 | 1072 | Buffer.prototype.slice=functionslice(start,end){ |
|
0 commit comments