summaryrefslogtreecommitdiff
path: root/benchmark/assert
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2018-05-30 03:41:57 +0000
committerRich Trott <rtrott@gmail.com>2018-06-02 05:17:22 +0200
commit07d3c55ecac5fd84d16b272bb233771336f35177 (patch)
tree159eaec18e07a98ab893be96e254daacecbbac20 /benchmark/assert
parent1000c785bd613475a93854ec09e9d110af923fbf (diff)
downloadandroid-node-v8-07d3c55ecac5fd84d16b272bb233771336f35177.tar.gz
android-node-v8-07d3c55ecac5fd84d16b272bb233771336f35177.tar.bz2
android-node-v8-07d3c55ecac5fd84d16b272bb233771336f35177.zip
benchmark: refactor deepequal-object
This is a minor refactor of benchmark/assert/deepequal-object.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-object.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/benchmark/assert/deepequal-object.js b/benchmark/assert/deepequal-object.js
index 4c95006b3b..124943b19e 100644
--- a/benchmark/assert/deepequal-object.js
+++ b/benchmark/assert/deepequal-object.js
@@ -29,13 +29,15 @@ function main({ size, n, method }) {
// TODO: Fix this "hack". `n` should not be manipulated.
n = n / size;
+ if (!method)
+ method = 'deepEqual';
+
const source = Array.apply(null, Array(size));
const actual = createObj(source);
const expected = createObj(source);
const expectedWrong = createObj(source, '4');
- // 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();