diff --git a/lib/buffer.js b/lib/buffer.js index cb93d7e2488f3b..b7840335c61efa 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -1056,8 +1056,6 @@ Buffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) { function checkInt(buffer, value, offset, ext, max, min) { - if (!isUint8Array(buffer)) - throw new TypeError('"buffer" argument must be a Buffer or Uint8Array'); if (value > max || value < min) throw new TypeError('"value" argument is out of bounds'); if (offset + ext > buffer.length) diff --git a/test/parallel/test-buffer-write-noassert.js b/test/parallel/test-buffer-write-noassert.js index ea5ca923f01983..7423e462ca1af2 100644 --- a/test/parallel/test-buffer-write-noassert.js +++ b/test/parallel/test-buffer-write-noassert.js @@ -20,14 +20,10 @@ function write(funx, args, result, res) { ); } - { - const error = /Int/.test(funx) ? - /^TypeError: "buffer" argument must be a Buffer or Uint8Array$/ : - /^TypeError: argument should be a Buffer$/; - + if (!/Int/.test(funx)) { assert.throws( () => Buffer.alloc(9)[funx].apply(new Uint32Array(1), args), - error + /^TypeError: argument should be a Buffer$/ ); }