summaryrefslogtreecommitdiff
path: root/lib/fs.js
diff options
context:
space:
mode:
authorAnatoli Papirovski <apapirovski@mac.com>2019-04-22 12:09:56 -0700
committerDaniel Bevenius <daniel.bevenius@gmail.com>2019-04-30 08:36:55 +0200
commitf4f937b296f62c11dfbd3a8f92abac81049b629e (patch)
treef1622dcc24185286d011a94944a2cb569f88716e /lib/fs.js
parentd33fddb7f43fffedb4f33f62e3d7b2af8a40f60b (diff)
downloadnode-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.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/fs.js b/lib/fs.js
index 9effb93acb..1b8ad7636e 100644
--- a/lib/fs.js
+++ b/lib/fs.js
@@ -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