Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 88e7386

Browse filesBrowse files
kktytargos
authored andcommitted
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>
1 parent 561c268 commit 88e7386
Copy full SHA for 88e7386

File tree

Expand file treeCollapse file tree

1 file changed

+1
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-2
lines changed
Open diff view settings
Collapse file

‎lib/internal/util.js‎

Copy file name to clipboardExpand all lines: lib/internal/util.js
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,9 @@ function promisify(original) {
267267
if (typeof fn !== 'function') {
268268
throw new ERR_INVALID_ARG_TYPE('util.promisify.custom', 'Function', fn);
269269
}
270-
Object.defineProperty(fn, kCustomPromisifiedSymbol, {
270+
return Object.defineProperty(fn, kCustomPromisifiedSymbol, {
271271
value: fn, enumerable: false, writable: false, configurable: true
272272
});
273-
return fn;
274273
}
275274

276275
// Names to create an object from in case the callback receives multiple

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.