diff --git a/lib/buffer.js b/lib/buffer.js index 73899ba1422..72a82c0134c 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -91,6 +91,10 @@ function allocPool () { function Buffer (subject, encoding, legacy, slice_legacy) { + if (!(this instanceof Buffer)) { + return new Buffer(subject, encoding, legacy, slice_legacy); + } + var length, type; // Are we slicing?