Skip to content

Commit

Permalink
util: simplify code
Browse files Browse the repository at this point in the history
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 Jan 1, 2019
1 parent 561c268 commit 88e7386
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/internal/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 88e7386

Please sign in to comment.