lib: replace string concatenation with template
PR-URL: https://github.com/nodejs/node/pull/16933 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
This commit is contained in:
parent
f5809d8e35
commit
107e8a9867
@ -115,7 +115,7 @@ function rethrow() {
|
||||
var backtrace = new Error();
|
||||
return function(err) {
|
||||
if (err) {
|
||||
backtrace.stack = err.name + ': ' + err.message +
|
||||
backtrace.stack = `${err.name}: ${err.message}` +
|
||||
backtrace.stack.substr(backtrace.name.length);
|
||||
throw backtrace;
|
||||
}
|
||||
@ -1894,7 +1894,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);
|
||||
};
|
||||
|
||||
|
||||
@ -1907,7 +1907,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);
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user