diff options
author | Rich Trott <rtrott@gmail.com> | 2021-12-20 07:03:58 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-20 07:03:58 +0300 |
commit | cf6996458b82ec0bdf97209bce380e1483c349fb (patch) | |
tree | 2ee6da67e46fa7ca89ad8252aa365809138e8936 /benchmark | |
parent | 3f7dabdfdc9e2a3cd3f92e377755c0dd43f6751b (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}`); } }; } |