Skip to content

Commit 40d4c54

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 2aabff9 commit 40d4c54

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
@@ -46,8 +46,7 @@ function rethrow() {
4646
if (err) {
4747
backtrace.stack = err.name + ': ' + err.message +
4848
backtrace.stack.substr(backtrace.name.length);
49-
err = backtrace;
50-
throw err;
49+
throw backtrace;
5150
}
5251
};
5352
}

0 commit comments

Comments
 (0)