Skip to content

Commit 4c0d9b7

Browse files
authored
Apply suggestions from code review
1 parent ce74a22 commit 4c0d9b7

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

benchmark/url/urlpattern-parse.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use strict';
22
const common = require('../common.js');
33
const { URLPattern } = require('url');
4+
const { ok } = require('assert');
45

56
const tests = [
67
'https://(sub.)?example(.com/)foo',
@@ -19,7 +20,8 @@ function main({ pattern, n }) {
1920
const inputPattern = JSON.parse(pattern);
2021
bench.start();
2122
for (let i = 0; i < n; i += 1) {
22-
new URLPattern(inputPattern);
23+
const p = new URLPattern(inputPattern);
24+
ok(p);
2325
}
2426
bench.end(n);
2527
}

benchmark/url/urlpattern-test.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use strict';
22
const common = require('../common.js');
33
const { URLPattern } = require('url');
4+
const { notStrictEqual } = require('assert');
45

56
const tests = [
67
'https://(sub.)?example(.com/)foo',
@@ -21,7 +22,8 @@ function main({ pattern, n }) {
2122

2223
bench.start();
2324
for (let i = 0; i < n; i += 1) {
24-
urlpattern.test('https://sub.example.com/foo');
25+
const p = urlpattern.test('https://sub.example.com/foo');
26+
notStrictEqual(p, undefined); // we don't care if it is true or false.
2527
}
2628
bench.end(n);
2729
}

0 commit comments

Comments
 (0)