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 <[email protected]>
Reviewed-By: Masashi Hirano <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
  • Loading branch information
kkty authored and MylesBorins committed May 16, 2019
1 parent 19ed5c7 commit 5dd31bc
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 @@ -260,10 +260,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 5dd31bc

Please sign in to comment.