Skip to content

Commit

Permalink
util: use ObjectHasOwn primordial
Browse files Browse the repository at this point in the history
Avoid Object.prototype.hasOwnProperty. Use primordial ObjectHasOwn
instead.
  • Loading branch information
Trott committed Jan 25, 2022
1 parent e2e2bc8 commit c3920db
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 @@ -4,6 +4,7 @@ const {
ArrayPrototypeConcat,
FunctionPrototypeBind,
ObjectDefineProperty,
ObjectHasOwn,
ObjectKeys,
} = primordials;

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 (ObjectHasOwn(consoleFromNode, key)) {
consoleFromNode[key] = FunctionPrototypeBind(
consoleCall,
consoleFromNode,
Expand Down

0 comments on commit c3920db

Please sign in to comment.