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