diff --git a/core/modules/utils/filesystem.js b/core/modules/utils/filesystem.js index 7ffe07ee7..57e916108 100644 --- a/core/modules/utils/filesystem.js +++ b/core/modules/utils/filesystem.js @@ -57,7 +57,7 @@ var FILE_BUFFER_LENGTH = 64 * 1024, exports.copyFile = function(srcPath,dstPath) { // Create buffer if required if(!fileBuffer) { - fileBuffer = new Buffer(FILE_BUFFER_LENGTH); + fileBuffer = Buffer.alloc(FILE_BUFFER_LENGTH); } // Create any directories in the destination $tw.utils.createDirectory(path.dirname(dstPath)); diff --git a/core/modules/utils/utils.js b/core/modules/utils/utils.js index 391cdd961..2c06cd5c3 100644 --- a/core/modules/utils/utils.js +++ b/core/modules/utils/utils.js @@ -712,7 +712,7 @@ exports.base64Decode = function(string64) { // TODO throw "$tw.utils.base64Decode() doesn't work in the browser"; } else { - return (new Buffer(string64,"base64")).toString(); + return Buffer.from(string64,"base64").toString(); } };