fs: use rest param & Reflect.apply in makeCallback

PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
Mithun Sasidharan 2017-12-06 23:15:34 +05:30 committed by Anatoli Papirovski
parent acd4277134
commit 0a0fbd5498
No known key found for this signature in database
GPG Key ID: 614E2E1ABEB4B2C0

View File

@ -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);
};
}