summaryrefslogtreecommitdiff
path: root/test/sequential/test-stringbytes-external-exceed-max-by-1-binary.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/sequential/test-stringbytes-external-exceed-max-by-1-binary.js')
-rw-r--r--test/sequential/test-stringbytes-external-exceed-max-by-1-binary.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/sequential/test-stringbytes-external-exceed-max-by-1-binary.js b/test/sequential/test-stringbytes-external-exceed-max-by-1-binary.js
index 0213140a5f..8689745528 100644
--- a/test/sequential/test-stringbytes-external-exceed-max-by-1-binary.js
+++ b/test/sequential/test-stringbytes-external-exceed-max-by-1-binary.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.