Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace deprecated new Buffer(string, 'base64') constructor with `Buffer.from(string, 'base64') #9801

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Replace deprecated constructor with
  • Loading branch information
yungRoz committed Jun 12, 2018
commit 09359efca07443babd410bd0e7fef64f54e92726
2 changes: 1 addition & 1 deletion test/font/ttxdriver.js
Original file line number Diff line number Diff line change
@@ -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');
2 changes: 1 addition & 1 deletion test/test.js
Original file line number Diff line number Diff line change
@@ -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.');
}