Replace deprecated constructor with

This commit is contained in:
youngroz 2018-06-11 20:41:56 -07:00
parent 2030d1718f
commit 09359efca0
2 changed files with 2 additions and 2 deletions

View File

@ -62,7 +62,7 @@ function runTtx(ttxResourcesHome, fontPath, registerOnCancel, callback) {
exports.translateFont = function translateFont(content, registerOnCancel,
callback) {
var buffer = new Buffer(content, 'base64');
var buffer = Buffer.from(content, 'base64');
var taskId = (nextTTXTaskId++).toString();
var fontPath = path.join(ttxResourcesHome, taskId + '.otf');
var resultPath = path.join(ttxResourcesHome, taskId + '.ttx');

View File

@ -320,7 +320,7 @@ function checkEq(task, results, browser, masterMode) {
}
var testSnapshot = pageResults[page].snapshot;
if (testSnapshot && testSnapshot.indexOf('data:image/png;base64,') === 0) {
testSnapshot = new Buffer(testSnapshot.substring(22), 'base64');
testSnapshot = Buffer.from(testSnapshot.substring(22), 'base64');
} else {
console.error('Valid snapshot was not found.');
}