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 14ea8fc

Browse filesBrowse files
Trottdanielleadams
authored andcommitted
doc: use Object.hasOwn() in util doc
Swtich from `hasOwnProperty()` to `Object.hasOwn()`. PR-URL: #41780 Reviewed-By: Mestery <mestery@protonmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent 9f77692 commit 14ea8fc
Copy full SHA for 14ea8fc

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

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

‎doc/api/util.md‎

Copy file name to clipboardExpand all lines: doc/api/util.md
+1-1Lines changed: 1 addition & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ const callbackFunction = util.callbackify(fn);
6767
callbackFunction((err, ret) => {
6868
// When the Promise was rejected with `null` it is wrapped with an Error and
6969
// the original value is stored in `reason`.
70-
err && err.hasOwnProperty('reason') && err.reason === null; // true
70+
err && Object.hasOwn(err, 'reason') && err.reason === null; // true
7171
});
7272
```
7373

0 commit comments

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