diff options
Diffstat (limited to 'test/sequential/test-stringbytes-external-exceed-max-by-1-ascii.js')
-rw-r--r-- | test/sequential/test-stringbytes-external-exceed-max-by-1-ascii.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/sequential/test-stringbytes-external-exceed-max-by-1-ascii.js b/test/sequential/test-stringbytes-external-exceed-max-by-1-ascii.js index 1e434d53b3..058bc435fc 100644 --- a/test/sequential/test-stringbytes-external-exceed-max-by-1-ascii.js +++ b/test/sequential/test-stringbytes-external-exceed-max-by-1-ascii.js @@ -17,9 +17,9 @@ assert(typeof gc === 'function', 'Run this test with --expose-gc'); const kStringMaxLength = process.binding('buffer').kStringMaxLength; try { - var buf = new Buffer(kStringMaxLength + 1); + var buf = Buffer.allocUnsafe(kStringMaxLength + 1); // Try to allocate memory first then force gc so future allocations succeed. - new Buffer(2 * kStringMaxLength); + Buffer.allocUnsafe(2 * kStringMaxLength); gc(); } catch (e) { // If the exception is not due to memory confinement then rethrow it. |