diff --git a/lib/buffer.js b/lib/buffer.js index 9163eb17c81afa..590b0d3905155d 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -228,8 +228,6 @@ function fromString(string, encoding) { length = binding.byteLengthUtf8(string); } else { length = byteLength(string, encoding, true); - if (length === -1) - throw new TypeError('"encoding" must be a valid string encoding'); if (string.length === 0) return new FastBuffer(); }