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 <benjamingr@gmail.com>
Reviewed-By: Tierney Cyren <hello@bnb.im>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
Trott authored and danielleadams committed Mar 14, 2022
1 parent 018ec32 commit 4aee98b
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 4aee98b

Please sign in to comment.