From 0c1ab2c7f7a6ebf7856df71dbd790d0d731f1b86 Mon Sep 17 00:00:00 2001 From: Kenta Moriuchi Date: Sat, 11 Nov 2023 17:23:01 +0900 Subject: [PATCH] fix(ext/node): Re-enable alloc max size test (#21059) Ref #21036 --- .../node_compat/test/parallel/test-buffer-alloc.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/cli/tests/node_compat/test/parallel/test-buffer-alloc.js b/cli/tests/node_compat/test/parallel/test-buffer-alloc.js index f6d74f6a1cc5e..46517ec1ec102 100644 --- a/cli/tests/node_compat/test/parallel/test-buffer-alloc.js +++ b/cli/tests/node_compat/test/parallel/test-buffer-alloc.js @@ -13,14 +13,12 @@ const assert = require('assert'); const SlowBuffer = require('buffer').SlowBuffer; -// TODO(bartlomieju): this test started failing after update to V8 12.0, -// maybe the size limit was increased? -// 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 ** 32 + 1), -// { message: 'Invalid typed array length: 4294967297' } -// ); +// Verify the maximum Uint8Array size. +// (see https://github.com/tc39/ecma262/pull/3052). +assert.throws( + () => new Uint8Array(2 ** 53), + { message: 'Invalid typed array length: 9007199254740992' } +); const b = Buffer.allocUnsafe(1024); assert.strictEqual(b.length, 1024);