if (targetStart < 0) {
throw new RangeError('targetStart out of bounds')
}
- if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
+ if (start < 0 || start >= this.length) throw new RangeError('Index out of range')
if (end < 0) throw new RangeError('sourceEnd out of bounds')
// Are we oob?
});
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);
var b = Buffer.alloc(1);
a.copy(b, 0, 0x100000000, 0x100000001);
}, { code: undefined, type: RangeError, message: 'Index out of range' });
-*/
+
// Unpooled buffer (replaces SlowBuffer)
{
var ubuf = Buffer.allocUnsafeSlow(10);