diff options
author | Anatoli Papirovski <apapirovski@mac.com> | 2019-04-22 12:09:56 -0700 |
---|---|---|
committer | Daniel Bevenius <daniel.bevenius@gmail.com> | 2019-04-30 08:36:55 +0200 |
commit | f4f937b296f62c11dfbd3a8f92abac81049b629e (patch) | |
tree | f1622dcc24185286d011a94944a2cb569f88716e /lib/fs.js | |
parent | d33fddb7f43fffedb4f33f62e3d7b2af8a40f60b (diff) | |
download | node-new-f4f937b296f62c11dfbd3a8f92abac81049b629e.tar.gz |
lib: remove Reflect.apply where appropriate
Using Reflect.apply where the callback context does not need
to change is unnecessary and less performant.
PR-URL: https://github.com/nodejs/node/pull/27349
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'lib/fs.js')
-rw-r--r-- | lib/fs.js | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -24,7 +24,7 @@ 'use strict'; -const { Math, Object, Reflect } = primordials; +const { Math, Object } = primordials; const { fs: constants } = internalBinding('constants'); const { @@ -133,9 +133,7 @@ function makeCallback(cb) { throw new ERR_INVALID_CALLBACK(cb); } - return (...args) => { - return Reflect.apply(cb, undefined, args); - }; + return (...args) => cb(...args); } // Special case of `makeCallback()` that is specific to async `*stat()` calls as |