mirror of
https://github.com/nodejs/node.git
synced 2025-05-02 16:22:29 +00:00

Files in benchmark/assert/* were sometimes using trailing commas for multi-line objects and sometimes not, mixing the approaches in the same file sometimes. Standardize these files to always use trailing commas in multi-line objects. Additionally, remove some unnecessary line-wrapping (so that there are fewer multi-line objects). PR-URL: https://github.com/nodejs/node/pull/25865 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
19 lines
333 B
JavaScript
19 lines
333 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common.js');
|
|
const assert = require('assert');
|
|
|
|
const bench = common.createBenchmark(main, { n: [1e5] });
|
|
|
|
function main({ n }) {
|
|
var i;
|
|
bench.start();
|
|
for (i = 0; i < n; ++i) {
|
|
if (i % 2 === 0)
|
|
assert(true);
|
|
else
|
|
assert(true, 'foo bar baz');
|
|
}
|
|
bench.end(n);
|
|
}
|