mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
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:
1 parent
14f8cee401
commit
4faf2ec783
1 file changed
+3
-3
@@ -101,7 +101,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;
|
||||
}
|
||||
@@ -1843,7 +1843,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);
|
||||
};
|
||||
|
||||
|
||||
@@ -1852,7 +1852,7 @@ fs.mkdtempSync = function(prefix, options) {
|
||||
throw new TypeError('filename prefix is required');
|
||||
options = getOptions(options, {});
|
||||
nullCheck(prefix);
|
||||
return binding.mkdtemp(prefix + 'XXXXXX', options.encoding);
|
||||
return binding.mkdtemp(`${prefix}XXXXXX`, options.encoding);
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user