Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'test/sequential/test-stringbytes-external-exceed-max-by-2.js')
-rw-r--r--test/sequential/test-stringbytes-external-exceed-max-by-2.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/sequential/test-stringbytes-external-exceed-max-by-2.js b/test/sequential/test-stringbytes-external-exceed-max-by-2.js
index db21608637d..a75b5059b94 100644
--- a/test/sequential/test-stringbytes-external-exceed-max-by-2.js
+++ b/test/sequential/test-stringbytes-external-exceed-max-by-2.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 + 2);
+ var buf = Buffer.allocUnsafe(kStringMaxLength + 2);
// 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.