Skip to content

Commit d08a8e6

Browse files
jasnellitaloacasas
authored andcommitted
buffer: avoid use of arguments
Avoid use of arguments in Buffer.prototype.toString() PR-URL: #11358 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Сковорода Никита Андреевич <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent 0762482 commit d08a8e6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/buffer.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -493,12 +493,12 @@ function slowToString(encoding, start, end) {
493493
}
494494

495495

496-
Buffer.prototype.toString = function() {
496+
Buffer.prototype.toString = function(encoding, start, end) {
497497
let result;
498498
if (arguments.length === 0) {
499499
result = this.utf8Slice(0, this.length);
500500
} else {
501-
result = slowToString.apply(this, arguments);
501+
result = slowToString.call(this, encoding, start, end);
502502
}
503503
if (result === undefined)
504504
throw new Error('"toString()" failed');

0 commit comments

Comments
 (0)