From 4faf2ec7839bbc25bd919401cfa88aa17b06fb81 Mon Sep 17 00:00:00 2001 From: Suryanarayana Murthy N Date: Fri, 10 Nov 2017 18:17:17 +0530 Subject: [PATCH] lib: replace string concatenation with template PR-URL: https://github.com/nodejs/node/pull/16933 Reviewed-By: Anatoli Papirovski Reviewed-By: Franziska Hinkelmann Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Gireesh Punathil --- lib/fs.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/fs.js b/lib/fs.js index 9c72994a72e549..feadde5f7e88ff 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -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); };