Skip to content

Commit 4d71442

Browse files
TrottMylesBorins
authored andcommitted
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: #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>
1 parent 9b0fc59 commit 4d71442

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎benchmark/assert/deepequal-object.js‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,15 @@ function main({ size, n, method }) {
2929
// TODO: Fix this "hack". `n` should not be manipulated.
3030
n=n/size;
3131

32+
if(!method)
33+
method='deepEqual';
34+
3235
constsource=Array.apply(null,Array(size));
3336
constactual=createObj(source);
3437
constexpected=createObj(source);
3538
constexpectedWrong=createObj(source,'4');
3639

37-
// eslint-disable-next-line no-restricted-properties
38-
constfn=method!=='' ? assert[method] : assert.deepEqual;
40+
constfn=assert[method];
3941
constvalue2=method.includes('not') ? expectedWrong : expected;
4042

4143
bench.start();

0 commit comments

Comments
 (0)