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 <apapirovski@mac.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benedikt Meurer <benedikt.meurer@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
  • 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.