diff --git a/dist/less.js b/dist/less.js index a6c11b223..ee0bd1184 100644 --- a/dist/less.js +++ b/dist/less.js @@ -13972,7 +13972,7 @@ Buffer.prototype.fill = function fill (val, start, end, encoding) { } else { var bytes = Buffer.isBuffer(val) ? val - : new Buffer(val, encoding) + : Buffer.from(val, encoding) var len = bytes.length for (i = 0; i < end - start; ++i) { this[i + start] = bytes[i % len] @@ -14251,7 +14251,7 @@ function clone(parent, circular, depth, prototype, includeNonEnumerable) { child = Buffer.allocUnsafe(parent.length); } else { // Older Node.js versions - child = new Buffer(parent.length); + child = Buffer.alloc(parent.length); } parent.copy(child); return child; diff --git a/lib/less-node/environment.js b/lib/less-node/environment.js index 104222afc..19077170b 100644 --- a/lib/less-node/environment.js +++ b/lib/less-node/environment.js @@ -1,6 +1,6 @@ module.exports = { encodeBase64: function encodeBase64(str) { - return new Buffer(str).toString('base64'); + return Buffer.from(str).toString('base64'); }, mimeLookup: function (filename) { return require('mime').lookup(filename); diff --git a/test/copy-bom.js b/test/copy-bom.js index c3941bf47..8d9621638 100644 --- a/test/copy-bom.js +++ b/test/copy-bom.js @@ -8,7 +8,7 @@ module.exports = function() { fs = require('fs'); var BUF_LENGTH = 64 * 1024; - var _buff = new Buffer(BUF_LENGTH); + var _buff = Buffer.alloc(BUF_LENGTH); function copyFolderWithBom(src, dest) { var stats = fs.lstatSync(src);