Skip to content
Permalink
Browse files

util: simplify code

Simplify code by using return value of Object.defineProperty directly.

PR-URL: #25162
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Masashi Hirano <shisama07@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information...
kkty authored and targos committed Dec 21, 2018
1 parent 561c268 commit 88e73862ca432759345a93e92ee1ee633cdd6a6c
Showing with 1 addition and 2 deletions.
  1. +1 −2 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

0 comments on commit 88e7386

Please sign in to comment.
You can’t perform that action at this time.