diff options
author | Rich Trott <rtrott@gmail.com> | 2021-12-20 07:03:58 +0300 |
---|---|---|
committer | Danielle Adams <adamzdanielle@gmail.com> | 2022-02-01 07:53:29 +0300 |
commit | e68bf84e312d0d5d6a6abd99a582daa36f739973 (patch) | |
tree | 39ccdf0770fa81b68249c2e06e8dba330807af91 /benchmark | |
parent | a47fc90c1abec2ff53e9e3fe0ad8fddd0735a353 (diff) |
benchmark,test: use Object.hasOwn() where applicable
Refs: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwn
PR-URL: https://github.com/nodejs/node/pull/41229
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Diffstat (limited to 'benchmark')
-rw-r--r-- | benchmark/common.js | 2 | ||||
-rw-r--r-- | benchmark/es/map-bench.js | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/benchmark/common.js b/benchmark/common.js index 28a317b9a1d..dbe69e31ad5 100644 --- a/benchmark/common.js +++ b/benchmark/common.js @@ -91,7 +91,7 @@ class Benchmark { process.exit(1); } const [, key, value] = match; - if (Object.prototype.hasOwnProperty.call(configs, key)) { + if (Object.hasOwn(configs, key)) { if (!cliOptions[key]) cliOptions[key] = []; cliOptions[key].push( diff --git a/benchmark/es/map-bench.js b/benchmark/es/map-bench.js index d0b8534cf7c..7e5e8824bfe 100644 --- a/benchmark/es/map-bench.js +++ b/benchmark/es/map-bench.js @@ -72,7 +72,7 @@ function fakeMap() { get(key) { return m[`$${key}`]; }, set(key, val) { m[`$${key}`] = val; }, get size() { return Object.keys(m).length; }, - has(key) { return Object.prototype.hasOwnProperty.call(m, `$${key}`); } + has(key) { return Object.hasOwn(m, `$${key}`); } }; } |