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:
parent
acd4277134
commit
0a0fbd5498
@ -145,8 +145,8 @@ function makeCallback(cb) {
|
|||||||
throw new errors.TypeError('ERR_INVALID_CALLBACK');
|
throw new errors.TypeError('ERR_INVALID_CALLBACK');
|
||||||
}
|
}
|
||||||
|
|
||||||
return function() {
|
return function(...args) {
|
||||||
return cb.apply(undefined, arguments);
|
return Reflect.apply(cb, undefined, args);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user