From cb989717b825117ee9ae6e4f33c215b5007ac4cc Mon Sep 17 00:00:00 2001 From: Volker Mische Date: Fri, 19 Jan 2018 15:47:45 +0100 Subject: [PATCH] Out of bounds error message changed --- index.js | 2 +- test/node/test-buffer-alloc.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 01977be..9481755 100644 --- a/index.js +++ b/index.js @@ -217,7 +217,7 @@ function fromArrayLike (array) { function fromArrayBuffer (array, byteOffset, length) { if (byteOffset < 0 || array.byteLength < byteOffset) { - throw new RangeError('\'offset\' is out of bounds') + throw new RangeError('"offset" is outside of buffer bounds') } if (array.byteLength < byteOffset + (length || 0)) { diff --git a/test/node/test-buffer-alloc.js b/test/node/test-buffer-alloc.js index 0bd87a3..597fa93 100644 --- a/test/node/test-buffer-alloc.js +++ b/test/node/test-buffer-alloc.js @@ -967,7 +967,7 @@ assert.strictEqual(SlowBuffer.prototype.offset, undefined); assert.doesNotThrow(() => Buffer.from('abc')); } -/* + // Test that ParseArrayIndex handles full uint32 { var errMsg = common.expectsError({ @@ -977,7 +977,7 @@ assert.strictEqual(SlowBuffer.prototype.offset, undefined); }); assert.throws(() => Buffer.from(new ArrayBuffer(0), -1 >>> 0), errMsg); } - +/* // ParseArrayIndex() should reject values that don't fit in a 32 bits size_t. common.expectsError(() => { var a = Buffer.alloc(1); -- 2.34.1