Skip to content

Commit 4aee98b

Browse files
Trottdanielleadams
authored andcommitted
util: use hasOwnProperty() primordial
Avoid Object.prototype.hasOwnProperty. Use primordial instead. PR-URL: #41692 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Tierney Cyren <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 018ec32 commit 4aee98b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/internal/util/inspector.js

Lines 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)