diff --git a/lib/buffer.js b/lib/buffer.js index f37bdcc60e..5f67ea104b 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -40,7 +40,7 @@ function alignPool() { } -function Buffer(arg) { +function Buffer(arg, encoding) { // Common case. if (typeof arg === 'number') { // If less than zero, or NaN. @@ -51,7 +51,7 @@ function Buffer(arg) { // Slightly less common case. if (typeof arg === 'string') { - return fromString(arg, arguments[1]); + return fromString(arg, encoding); } // Unusual.