From acc92a77cb18b3d18cf74f1ceb7afe5d610c573d Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 25 Jan 2022 07:14:18 -0800 Subject: 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(-) (limited to 'lib') diff --git a/lib/internal/util/inspector.js b/lib/internal/util/inspector.js index cf8651c33ad..a94289b17d0 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, -- cgit v1.2.3