Skip to content

Commit ad0c9ac

Browse files
committed
benchmark: use boolean options in benchmark tests
Use boolean values for randomUUID benchmark and deprecate benchmark instead of 0/1.
1 parent 5f9d07f commit ad0c9ac

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

benchmark/crypto/randomUUID.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ const { randomUUID } = require('crypto');
55

66
const bench = common.createBenchmark(main, {
77
n: [1e7],
8-
disableEntropyCache: [0, 1],
8+
disableEntropyCache: [false, true],
99
});
1010

1111
function main({ n, disableEntropyCache }) {
12-
disableEntropyCache = !!disableEntropyCache;
1312
bench.start();
1413
for (let i = 0; i < n; ++i)
1514
randomUUID({ disableEntropyCache });

benchmark/util/deprecate.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const assert = require('assert');
55

66
const bench = common.createBenchmark(main, {
77
n: [1e5],
8-
modifyPrototype: [1, 0],
8+
modifyPrototype: [true, false],
99
emitWarningSync: [1, 0],
1010
}, {
1111
flags: ['--expose-internals'],
@@ -23,7 +23,7 @@ function main({ n, modifyPrototype, emitWarningSync }) {
2323
'This function is deprecated',
2424
'DEP0000',
2525
emitWarningSync,
26-
!!modifyPrototype,
26+
modifyPrototype,
2727
);
2828

2929
let sum = 0;

0 commit comments

Comments
 (0)