aboutsummaryrefslogtreecommitdiff
path: root/lib/util.js
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2019-03-24 22:20:55 +0100
committerRuben Bridgewater <ruben@bridgewater.de>2019-03-27 22:45:20 +0100
commitb5ea925c8e30aa85f1821f3bd9833b52608bf91e (patch)
tree4019a009c9be2c78b87c169dab06c33f8c4ab39a /lib/util.js
parent46bf0d0f4fde508d48ef91e4044c2ce0d3f942ca (diff)
downloadandroid-node-v8-b5ea925c8e30aa85f1821f3bd9833b52608bf91e.tar.gz
android-node-v8-b5ea925c8e30aa85f1821f3bd9833b52608bf91e.tar.bz2
android-node-v8-b5ea925c8e30aa85f1821f3bd9833b52608bf91e.zip
util: don't set the prototype of callbackified functions
Using `util.callbackify()` should not set the prototype for the returned function to the one from the input function. It could cause confusion while debugging otherwise. PR-URL: https://github.com/nodejs/node/pull/26893 Fixes: https://github.com/nodejs/node/issues/26890 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Diffstat (limited to 'lib/util.js')
-rw-r--r--lib/util.js1
1 files changed, 0 insertions, 1 deletions
diff --git a/lib/util.js b/lib/util.js
index 4db05e478c..f58f0e7a3e 100644
--- a/lib/util.js
+++ b/lib/util.js
@@ -194,7 +194,6 @@ function callbackify(original) {
(rej) => process.nextTick(callbackifyOnRejected, rej, cb));
}
- Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original));
const descriptors = Object.getOwnPropertyDescriptors(original);
// It is possible to manipulate a functions `length` or `name` property. This
// guards against the manipulation.