mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
29e74d4952
Code in benchmark directory sometimes uses `function () {}` for anonymous callbacks and sometimes uses `() => {}`. Multi-line arrays sometimes have a trailing comma and sometimes do not. Update to always use arrow functions for anonymous callbacks and trailing commas for multiline arrays. PR-URL: https://github.com/nodejs/node/pull/25944 Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
21 lines
571 B
JavaScript
21 lines
571 B
JavaScript
'use strict';
|
|
const common = require('../common.js');
|
|
const querystring = require('querystring');
|
|
|
|
const bench = common.createBenchmark(main, {
|
|
input: [
|
|
'there is nothing to unescape here',
|
|
'there%20are%20several%20spaces%20that%20need%20to%20be%20unescaped',
|
|
'there%2Qare%0-fake%escaped values in%%%%this%9Hstring',
|
|
'%20%21%22%23%24%25%26%27%28%29%2A%2B%2C%2D%2E%2F%30%31%32%33%34%35%36%37',
|
|
],
|
|
n: [10e6],
|
|
});
|
|
|
|
function main({ input, n }) {
|
|
bench.start();
|
|
for (var i = 0; i < n; i += 1)
|
|
querystring.unescapeBuffer(input);
|
|
bench.end(n);
|
|
}
|