diff --git a/lib/internal/util.js b/lib/internal/util.js index 7af06351c91406..652e75504060aa 100644 --- a/lib/internal/util.js +++ b/lib/internal/util.js @@ -267,10 +267,9 @@ function promisify(original) { if (typeof fn !== 'function') { throw new ERR_INVALID_ARG_TYPE('util.promisify.custom', 'Function', fn); } - Object.defineProperty(fn, kCustomPromisifiedSymbol, { + return Object.defineProperty(fn, kCustomPromisifiedSymbol, { value: fn, enumerable: false, writable: false, configurable: true }); - return fn; } // Names to create an object from in case the callback receives multiple