From 4aee98b03c72d0cbdf956687346fb91abdafb4c4 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 25 Jan 2022 07:14:18 -0800 Subject: [PATCH] util: use hasOwnProperty() primordial Avoid Object.prototype.hasOwnProperty. Use primordial instead. PR-URL: https://github.com/nodejs/node/pull/41692 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Tierney Cyren Reviewed-By: Luigi Pinca --- lib/internal/util/inspector.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/internal/util/inspector.js b/lib/internal/util/inspector.js index cf8651c33ad6d0..a94289b17d012e 100644 --- a/lib/internal/util/inspector.js +++ b/lib/internal/util/inspector.js @@ -5,6 +5,7 @@ const { FunctionPrototypeBind, ObjectDefineProperty, ObjectKeys, + ObjectPrototypeHasOwnProperty, } = primordials; let session; @@ -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,