Skip to content

Commit de2a7f1

Browse files
committed
fs: removing unnecessary assignment
In `rethrow` function, instead of assigning to `err` and throwing `err`, we can directly throw `backtrace` object itself.
1 parent baa8c37 commit de2a7f1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/fs.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ function rethrow() {
4949
if (err) {
5050
backtrace.stack = err.name + ': ' + err.message +
5151
backtrace.stack.substr(backtrace.name.length);
52-
err = backtrace;
53-
throw err;
52+
throw backtrace;
5453
}
5554
};
5655
}

0 commit comments

Comments
 (0)