From ae8f2170653d2500c12f797020e6fc0a6224f558 Mon Sep 17 00:00:00 2001 From: Ben Newman Date: Fri, 12 Apr 2019 18:46:01 -0400 Subject: [PATCH] Use Buffer.alloc instead of the Buffer constructor. https://circleci.com/gh/meteor/meteor/32465 --- tools/fs/files.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/fs/files.js b/tools/fs/files.js index 02a4c7353e..ea59f3aab2 100644 --- a/tools/fs/files.js +++ b/tools/fs/files.js @@ -1878,7 +1878,7 @@ files.unwatchFile = function (...args) { }; files.readBufferWithLengthAndOffset = function (filename, length, offset) { - var data = new Buffer(length); + var data = Buffer.alloc(length); // Read the data from disk, if it is non-empty. Avoid doing IO for empty // files, because (a) unnecessary and (b) fs.readSync with length 0 // throws instead of acting like POSIX read: