From fb249b89313cd74da404e50b6655f27dc4f5be53 Mon Sep 17 00:00:00 2001 From: Volker Mische Date: Sun, 21 Jan 2018 01:37:01 +0100 Subject: [PATCH] const is needed to fix some test --- test/node/test-buffer-alloc.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/node/test-buffer-alloc.js b/test/node/test-buffer-alloc.js index 9802b52..5d0e032 100644 --- a/test/node/test-buffer-alloc.js +++ b/test/node/test-buffer-alloc.js @@ -29,7 +29,8 @@ assert.strictEqual(0, d.length); // Test offset properties { - var b = Buffer.alloc(128); + // NOTE vmx 2018-01-21: Without this `const` later tests will fail + const b = Buffer.alloc(128); assert.strictEqual(128, b.length); assert.strictEqual(0, b.byteOffset); assert.strictEqual(0, b.offset); @@ -164,7 +165,7 @@ assert.doesNotThrow(() => Buffer.alloc(1).write('', 1, 0)); assert.strictEqual(sliceA[i], sliceB[i]); } } -/* + { var slice = b.slice(100, 150); assert.strictEqual(50, slice.length); @@ -172,7 +173,7 @@ assert.doesNotThrow(() => Buffer.alloc(1).write('', 1, 0)); assert.strictEqual(b[100 + i], slice[i]); } } -*/ + { // make sure only top level parent propagates from allocPool var b = Buffer.allocUnsafe(5); -- 2.34.1