From 40d4c54524416ebb39152676dfb40a05d0f10ad6 Mon Sep 17 00:00:00 2001 From: Sakthipriyan Vairamani Date: Tue, 2 Jun 2015 22:46:15 +0530 Subject: [PATCH] fs: removing unnecessary assignment In `rethrow` function, instead of assigning to `err` and throwing `err`, we can directly throw `backtrace` object itself. --- lib/fs.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/fs.js b/lib/fs.js index 53cb7de8a05fde..7a5bfee6ba24df 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -46,8 +46,7 @@ function rethrow() { if (err) { backtrace.stack = err.name + ': ' + err.message + backtrace.stack.substr(backtrace.name.length); - err = backtrace; - throw err; + throw backtrace; } }; }