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: Replacing the string concatenation with string template #16933

Closed
wants to merge 3 commits into from
Closed
Changes from 2 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
8 changes: 4 additions & 4 deletions lib/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ function rethrow() {
var backtrace = new Error();
return function(err) {
if (err) {
backtrace.stack = err.name + ': ' + err.message +
backtrace.stack.substr(backtrace.name.length);
backtrace.stack = `${err.name}: ${err.message}` +
`${backtrace.stack.substr(`${backtrace.name.length}`)}`;
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like this second line could be left as it was. Just the first line needs to be a template literal.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review comments @apapirovski . Have made the necessary changes and did a fresh commit.

throw backtrace;
}
};
Expand Down Expand Up @@ -1874,7 +1874,7 @@ fs.mkdtemp = function(prefix, options, callback) {
var req = new FSReqWrap();
req.oncomplete = callback;

binding.mkdtemp(prefix + 'XXXXXX', options.encoding, req);
binding.mkdtemp(`${prefix}XXXXXX`, options.encoding, req);
};


Expand All @@ -1887,7 +1887,7 @@ fs.mkdtempSync = function(prefix, options) {
}
options = getOptions(options, {});
nullCheck(prefix);
return binding.mkdtemp(prefix + 'XXXXXX', options.encoding);
return binding.mkdtemp(`${prefix}XXXXXX`, options.encoding);
};


Expand Down