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

lib: replace string concatenation with template #16920

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/child_process.js
Expand Up @@ -46,7 +46,7 @@ function stdioStringToArray(option) {
case 'inherit':
return [option, option, option, 'ipc'];
default:
throw new TypeError('Incorrect value of stdio option: ' + option);
throw new TypeError(`Incorrect value of stdio option: ${option}`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is another PR open that will be landing soon that changes this error message. It's likely safe to omit this change here and just wait for the other PR to land.

}
}

Expand Down Expand Up @@ -266,10 +266,10 @@ exports.execFile = function(file /*, args, options, callback*/) {
}

if (args.length !== 0)
cmd += ' ' + args.join(' ');
cmd += ` ${args.join(' ')}`;

if (!ex) {
ex = new Error('Command failed: ' + cmd + '\n' + stderr);
ex = new Error(`Command failed: ${cmd}\n${stderr}`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likewise here, it's not likely worth changing the string concatenations in error throws since those will be changing very soon.

ex.killed = child.killed || killed;
ex.code = code < 0 ? errname(code) : code;
ex.signal = signal;
Expand Down Expand Up @@ -475,7 +475,7 @@ function normalizeSpawnArguments(file, args, options) {
var envPairs = [];

for (var key in env) {
envPairs.push(key + '=' + env[key]);
envPairs.push(`${key}=${env[key]}`);
}

_convertCustomFds(options);
Expand Down Expand Up @@ -570,7 +570,7 @@ function checkExecSyncError(ret, args, cmd) {
var msg = 'Command failed: ';
msg += cmd || args.join(' ');
if (ret.stderr && ret.stderr.length > 0)
msg += '\n' + ret.stderr.toString();
msg += `\n${ret.stderr.toString()}`;
err = new Error(msg);
}
if (err) {
Expand Down