From 6fbb00e8873f7985784a0c8287504a52735a5ea6 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 30 May 2018 03:45:24 +0000 Subject: [PATCH] benchmark: refactor prims-and-objs-big-array-set MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a minor refactor of benchmark/assert/deepequal-prims-and-objs-big-array-set.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 Reviewed-By: James M Snell Reviewed-By: Luigi Pinca Reviewed-By: Trivikram Kamat --- .../deepequal-prims-and-objs-big-array-set.js | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/benchmark/assert/deepequal-prims-and-objs-big-array-set.js b/benchmark/assert/deepequal-prims-and-objs-big-array-set.js index 90dbf1059361a5..4578e5a250f392 100644 --- a/benchmark/assert/deepequal-prims-and-objs-big-array-set.js +++ b/benchmark/assert/deepequal-prims-and-objs-big-array-set.js @@ -1,7 +1,8 @@ 'use strict'; const common = require('../common.js'); -const assert = require('assert'); +const { deepEqual, deepStrictEqual, notDeepEqual, notDeepStrictEqual } = + require('assert'); const primValues = { 'null': null, @@ -61,32 +62,28 @@ function main({ n, len, primitive, method }) { // Empty string falls through to next line as default, mostly for tests. case '': case 'deepEqual_Array': - // eslint-disable-next-line no-restricted-properties - run(assert.deepEqual, n, actual, expected); + run(deepEqual, n, actual, expected); break; case 'deepStrictEqual_Array': - run(assert.deepStrictEqual, n, actual, expected); + run(deepStrictEqual, n, actual, expected); break; case 'notDeepEqual_Array': - // eslint-disable-next-line no-restricted-properties - run(assert.notDeepEqual, n, actual, expectedWrong); + run(notDeepEqual, n, actual, expectedWrong); break; case 'notDeepStrictEqual_Array': - run(assert.notDeepStrictEqual, n, actual, expectedWrong); + run(notDeepStrictEqual, n, actual, expectedWrong); break; case 'deepEqual_Set': - // eslint-disable-next-line no-restricted-properties - run(assert.deepEqual, n, actualSet, expectedSet); + run(deepEqual, n, actualSet, expectedSet); break; case 'deepStrictEqual_Set': - run(assert.deepStrictEqual, n, actualSet, expectedSet); + run(deepStrictEqual, n, actualSet, expectedSet); break; case 'notDeepEqual_Set': - // eslint-disable-next-line no-restricted-properties - run(assert.notDeepEqual, n, actualSet, expectedWrongSet); + run(notDeepEqual, n, actualSet, expectedWrongSet); break; case 'notDeepStrictEqual_Set': - run(assert.notDeepStrictEqual, n, actualSet, expectedWrongSet); + run(notDeepStrictEqual, n, actualSet, expectedWrongSet); break; default: throw new Error(`Unsupported method "${method}"`);