diff --git a/lib/internal/util.js b/lib/internal/util.js index 1719c8a57ee1e2..5591426aeee69b 100644 --- a/lib/internal/util.js +++ b/lib/internal/util.js @@ -335,14 +335,10 @@ function promisify(original, options = undefined) { validateFunction(original, 'original'); // No validateObject so .map(util.promisify) can work - if (options == null || typeof options !== 'object') { - options = ObjectCreate(null); - } - const { - resolveArray = false, - resolveObject = null, - callbackPosition = null, - } = options; + const useDefaultOptions = options == null || typeof options !== 'object'; + const resolveArray = useDefaultOptions ? false : options.resolveArray; + const resolveObject = useDefaultOptions ? null : options.resolveObject; + const callbackPosition = useDefaultOptions ? null : options.callbackPosition; if (original[kCustomPromisifiedSymbol]) { const fn = original[kCustomPromisifiedSymbol];