tools: replace concatenation with string templates · nodejs/node@2409db6

Original file line numberDiff line numberDiff line change

@@ -155,7 +155,7 @@ if (cluster.isMaster) {

155155

} else {

156156

failures += results.length;

157157

}

158-

outFn(formatter(results) + '\r\n');

158+

outFn(`${formatter(results)}\r\n`);

159159

printProgress();

160160

} else {

161161

successes += results;

@@ -211,7 +211,7 @@ if (cluster.isMaster) {

211211

return;

212212
213213

// Clear line

214-

outFn('\r' + ' '.repeat(lastLineLen) + '\r');

214+

outFn(`\r ${' '.repeat(lastLineLen)}\r`);

215215
216216

// Calculate and format the data for displaying

217217

const elapsed = process.hrtime(startTime)[0];

@@ -226,7 +226,7 @@ if (cluster.isMaster) {

226226
227227

// Truncate line like cpplint does in case it gets too long

228228

if (line.length > 75)

229-

line = line.slice(0, 75) + '...';

229+

line = `${line.slice(0, 75)}...`;

230230
231231

// Store the line length so we know how much to erase the next time around

232232

lastLineLen = line.length;

@@ -235,7 +235,7 @@ if (cluster.isMaster) {

235235

}

236236
237237

function padString(str, len, chr) {

238-

str = '' + str;

238+

str = `${str}`;

239239

if (str.length >= len)

240240

return str;

241241

return chr.repeat(len - str.length) + str;