diff --git a/lib/buffer.js b/lib/buffer.js index 3f47677dd56469..6ca079223723fc 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -493,12 +493,12 @@ function slowToString(encoding, start, end) { } -Buffer.prototype.toString = function() { +Buffer.prototype.toString = function(encoding, start, end) { let result; if (arguments.length === 0) { result = this.utf8Slice(0, this.length); } else { - result = slowToString.apply(this, arguments); + result = slowToString.call(this, encoding, start, end); } if (result === undefined) throw new Error('"toString()" failed');