mirror of
https://github.com/nodejs/node.git
synced 2026-11-29 14:27:57 -05:00
test: update tests for larger Buffers
V8 is about to increase the max TypedArray length to 2**32-1, which Node inherits as Buffer.kMaxLength. Some tests relied on values greater than the previous max length (2**31-1) to throw errors; this updates those tests for the new max length. PR-URL: https://github.com/nodejs/node/pull/32114 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
This commit is contained in:
1 parent
400083b9f5
commit
256bc4412c
2 files changed
+3
-3
No files matched your search
@@ -8,8 +8,8 @@ const SlowBuffer = require('buffer').SlowBuffer;
|
||||
// Verify the maximum Uint8Array size. There is no concrete limit by spec. The
|
||||
// internal limits should be updated if this fails.
|
||||
assert.throws(
|
||||
() => new Uint8Array(2 ** 31),
|
||||
{ message: 'Invalid typed array length: 2147483648' }
|
||||
() => new Uint8Array(2 ** 32),
|
||||
{ message: 'Invalid typed array length: 4294967296' }
|
||||
);
|
||||
|
||||
const b = Buffer.allocUnsafe(1024);
|
||||
|
||||
Reference in new issue
Block a user