Skip to content

Commit 552c945

Browse files
Trotttargos
authored andcommitted
test: remove unneeded m flag on regular expressions
The m flag has no effect on regular expressions that don't match the start or the end of a line. PR-URL: #38124 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent e999da7 commit 552c945

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

test/js-native-api/test_exception/testFinalizerException.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ const child = spawnSync(process.execPath, [
2929
'--expose-gc', __filename, 'child'
3030
]);
3131
assert.strictEqual(child.signal, null);
32-
assert.match(child.stderr.toString(), /Error during Finalize/m);
32+
assert.match(child.stderr.toString(), /Error during Finalize/);

test/parallel/test-readline-async-iterators.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ async function testSimple() {
3939
expectedLines.pop();
4040
}
4141
assert.deepStrictEqual(iteratedLines, expectedLines);
42-
assert.strictEqual(iteratedLines.join(''), fileContent.replace(/\n/gm, ''));
42+
assert.strictEqual(iteratedLines.join(''), fileContent.replace(/\n/g, ''));
4343
}
4444
}
4545

test/report/test-report-uv-handles.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,14 @@ if (process.argv[2] === 'child') {
9797

9898
// Test libuv handle key order
9999
{
100-
const get_libuv = /"libuv":\s\[([\s\S]*?)\]/gm;
101-
const get_handle_inner = /{([\s\S]*?),*?}/gm;
100+
const get_libuv = /"libuv":\s\[([\s\S]*?)\]/g;
101+
const get_handle_inner = /{([\s\S]*?),*?}/g;
102102
const libuv_handles_str = get_libuv.exec(stdout)[1];
103103
const libuv_handles_array = libuv_handles_str.match(get_handle_inner);
104104
for (const i of libuv_handles_array) {
105105
// Exclude nested structure
106106
if (i.includes('type')) {
107-
const handle_keys = i.match(/(".*"):/gm);
107+
const handle_keys = i.match(/(".*"):/g);
108108
assert(handle_keys[0], 'type');
109109
assert(handle_keys[1], 'is_active');
110110
}

0 commit comments

Comments
 (0)