| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 605f830 commit 723977f
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -31,8 +31,8 @@ const { | |||
| 31 | 31 | const { isArrayBufferView } = require('internal/util/types'); | |
| 32 | 32 | const { FastBuffer } = require('internal/buffer'); | |
| 33 | 33 | ||
| 34 | - const kMaxUint32 = 2 ** 32 - 1; | ||
| 35 | - const kMaxPossibleLength = MathMin(kMaxLength, kMaxUint32); | ||
| 34 | + const kMaxInt32 = 2 ** 31 - 1; | ||
| 35 | + const kMaxPossibleLength = MathMin(kMaxLength, kMaxInt32); | ||
| 36 | 36 | ||
| 37 | 37 | function assertOffset(offset, elementSize, length) { | |
| 38 | 38 | validateNumber(offset, 'offset'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -31,8 +31,8 @@ const crypto = require('crypto'); | |||
| 31 | 31 | const { kMaxLength } = require('buffer'); | |
| 32 | 32 | const { inspect } = require('util'); | |
| 33 | 33 | ||
| 34 | - const kMaxUint32 = Math.pow(2, 32) - 1; | ||
| 35 | - const kMaxPossibleLength = Math.min(kMaxLength, kMaxUint32); | ||
| 34 | + const kMaxInt32 = 2 ** 31 - 1; | ||
| 35 | + const kMaxPossibleLength = Math.min(kMaxLength, kMaxInt32); | ||
| 36 | 36 | ||
| 37 | 37 | common.expectWarning('DeprecationWarning', | |
| 38 | 38 | 'crypto.pseudoRandomBytes is deprecated.', 'DEP0115'); | |
@@ -50,7 +50,7 @@ common.expectWarning('DeprecationWarning', | |||
| 50 | 50 | assert.throws(() => f(value, common.mustNotCall()), errObj); | |
| 51 | 51 | }); | |
| 52 | 52 | ||
| 53 | - [-1, NaN, 2 ** 32].forEach((value) => { | ||
| 53 | + [-1, NaN, 2 ** 32, 2 ** 31].forEach((value) => { | ||
| 54 | 54 | const errObj = { | |
| 55 | 55 | code: 'ERR_OUT_OF_RANGE', | |
| 56 | 56 | name: 'RangeError', | |
| Back | FazBrowse Home | New Git URL |
0 commit comments