Skip to content

Commit

Permalink
Merge pull request #9801 from yungRoz/replace-deprecated-buffer-const…
Browse files Browse the repository at this point in the history
…ructor

Replace deprecated `new Buffer(string, 'base64')` constructor with `Buffer.from(string, 'base64')
  • Loading branch information
timvandermeij authored Jun 13, 2018
2 parents 2030d17 + 09359ef commit b590519
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/font/ttxdriver.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
}
Expand Down

0 comments on commit b590519

Please sign in to comment.