Skip to content

Commit

Permalink
fs: use rest param & Reflect.apply in makeCallback
Browse files Browse the repository at this point in the history
PR-URL: #17486
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Benedikt Meurer <[email protected]>
Reviewed-By: Timothy Gu <[email protected]>
  • Loading branch information
mithunsasidharan authored and MylesBorins committed Dec 12, 2017
1 parent f399667 commit 715baf8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ function makeCallback(cb) {
throw new errors.TypeError('ERR_INVALID_CALLBACK');
}

return function() {
return cb.apply(undefined, arguments);
return function(...args) {
return Reflect.apply(cb, undefined, args);
};
}

Expand Down

0 comments on commit 715baf8

Please sign in to comment.