mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
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>
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user