Skip to content

Commit

Permalink
util: use hasOwnProperty() primordial
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Trott committed Jan 27, 2022
1 parent 5d9caa1 commit acc92a7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/internal/util/inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const {
FunctionPrototypeBind,
ObjectDefineProperty,
ObjectKeys,
ObjectPrototypeHasOwnProperty,
} = primordials;

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

0 comments on commit acc92a7

Please sign in to comment.