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 aee74c8

Browse filesBrowse files
Trottruyadorno
authored andcommitted
util: use hasOwnProperty() primordial
Avoid Object.prototype.hasOwnProperty. Use primordial instead. PR-URL: #41692 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Tierney Cyren <hello@bnb.im> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent a05b832 commit aee74c8
Copy full SHA for aee74c8

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

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

‎lib/internal/util/inspector.js‎

Copy file name to clipboardExpand all lines: lib/internal/util/inspector.js
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const {
55
FunctionPrototypeBind,
66
ObjectDefineProperty,
77
ObjectKeys,
8+
ObjectPrototypeHasOwnProperty,
89
} = primordials;
910

1011
let session;
@@ -43,7 +44,7 @@ function wrapConsole(consoleFromNode, consoleFromVM) {
4344
// If global console has the same method as inspector console,
4445
// then wrap these two methods into one. Native wrapper will preserve
4546
// the original stack.
46-
if (consoleFromNode.hasOwnProperty(key)) {
47+
if (ObjectPrototypeHasOwnProperty(consoleFromNode, key)) {
4748
consoleFromNode[key] = FunctionPrototypeBind(
4849
consoleCall,
4950
consoleFromNode,

0 commit comments

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