diff options
author | Rich Trott <rtrott@gmail.com> | 2022-01-25 18:14:18 +0300 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2022-01-27 22:49:18 +0300 |
commit | acc92a77cb18b3d18cf74f1ceb7afe5d610c573d (patch) | |
tree | 43e0e8c40c3c4221dece6d49ad4baecc28d9b281 /lib | |
parent | 5d9caa1c2f24e5e677348812f2a938847dc9690d (diff) |
util: use hasOwnProperty() primordial
Avoid Object.prototype.hasOwnProperty. Use primordial instead.
PR-URL: https://github.com/nodejs/node/pull/41692
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tierney Cyren <hello@bnb.im>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/internal/util/inspector.js | 3 |
1 files changed, 2 insertions, 1 deletions
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, |