summaryrefslogtreecommitdiff
path: root/benchmark/assert
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2018-05-30 03:53:11 +0000
committerRich Trott <rtrott@gmail.com>2018-06-02 05:17:28 +0200
commitb8f8ca570243bb58337e547f7bf10515cfab0ea5 (patch)
tree2aaaa3b9fb2e8f1e93f97aba87e06601959d6162 /benchmark/assert
parent9cd4a23b796617e6920072bae5771f1bbdf22197 (diff)
downloadandroid-node-v8-b8f8ca570243bb58337e547f7bf10515cfab0ea5.tar.gz
android-node-v8-b8f8ca570243bb58337e547f7bf10515cfab0ea5.tar.bz2
android-node-v8-b8f8ca570243bb58337e547f7bf10515cfab0ea5.zip
benchmark: refactor deepequal-typedarrays
This is a minor refactor of benchmark/assert/deepequal-typedarrays.js to reduce exceptions that need to be made for lint compliance. PR-URL: https://github.com/nodejs/node/pull/21030 Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Diffstat (limited to 'benchmark/assert')
-rw-r--r--benchmark/assert/deepequal-typedarrays.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/benchmark/assert/deepequal-typedarrays.js b/benchmark/assert/deepequal-typedarrays.js
index 50e6e525b2..c4d8f434bf 100644
--- a/benchmark/assert/deepequal-typedarrays.js
+++ b/benchmark/assert/deepequal-typedarrays.js
@@ -25,6 +25,8 @@ const bench = common.createBenchmark(main, {
});
function main({ type, n, len, method }) {
+ if (!method)
+ method = 'deepEqual';
const clazz = global[type];
const actual = new clazz(len);
const expected = new clazz(len);
@@ -32,8 +34,7 @@ function main({ type, n, len, method }) {
const wrongIndex = Math.floor(len / 2);
expectedWrong[wrongIndex] = 123;
- // eslint-disable-next-line no-restricted-properties
- const fn = method !== '' ? assert[method] : assert.deepEqual;
+ const fn = assert[method];
const value2 = method.includes('not') ? expectedWrong : expected;
bench.start();