Skip to content

Commit 5f177eb

Browse files
committed
test: add comments to empty blocks
1 parent 3ecbf38 commit 5f177eb

File tree

45 files changed

+249
-120
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+249
-120
lines changed

test/addons/uv-handle-leak/test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ try {
1616
const { isMainThread } = require('worker_threads');
1717
if (!isMainThread)
1818
common.skip('Cannot run test in environment with clean-exit policy');
19-
} catch {}
19+
} catch {
20+
// Continue regardless of error
21+
}
2022

2123
binding.leakHandle();
2224
binding.leakHandle(0);

test/common/inspector-helper.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,9 @@ class NodeInstance extends EventEmitter {
365365
['--expose-internals'],
366366
`${scriptContents}\nprocess._rawDebug('started');`, undefined);
367367
const msg = 'Timed out waiting for process to start';
368-
while (await fires(instance.nextStderrString(), msg, TIMEOUT) !==
369-
'started') {}
368+
while (await fires(instance.nextStderrString(), msg, TIMEOUT) !== 'started') {
369+
// empty
370+
}
370371
process._debugProcess(instance._process.pid);
371372
return instance;
372373
}

test/common/report.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ function validateContent(report, fields = []) {
4646
} catch (err) {
4747
try {
4848
err.stack += util.format('\n------\nFailing Report:\n%O', report);
49-
} catch {}
49+
} catch {
50+
// Continue regardless of error
51+
}
5052
throw err;
5153
}
5254
}

test/internet/test-dgram-broadcast-multi-process.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,9 @@ if (process.argv[2] !== 'child') {
184184
const buf = messages[i++];
185185

186186
if (!buf) {
187-
try { sendSocket.close(); } catch {}
187+
try { sendSocket.close(); } catch {
188+
// Continue regardless of error
189+
}
188190
return;
189191
}
190192

test/internet/test-dgram-multicast-multi-process.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,9 @@ if (process.argv[2] !== 'child') {
170170
const buf = messages[i++];
171171

172172
if (!buf) {
173-
try { sendSocket.close(); } catch {}
173+
try { sendSocket.close(); } catch {
174+
// Continue regardless of error
175+
}
174176
return;
175177
}
176178

test/internet/test-dgram-multicast-ssm-multi-process.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,9 @@ if (process.argv[2] !== 'child') {
164164
const buf = messages[i++];
165165

166166
if (!buf) {
167-
try { sendSocket.close(); } catch {}
167+
try { sendSocket.close(); } catch {
168+
// Continue regardless of error
169+
}
168170
return;
169171
}
170172

test/internet/test-dgram-multicast-ssmv6-multi-process.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,9 @@ if (process.argv[2] !== 'child') {
164164
const buf = messages[i++];
165165

166166
if (!buf) {
167-
try { sendSocket.close(); } catch {}
167+
try { sendSocket.close(); } catch {
168+
// Continue regardless of error
169+
}
168170
return;
169171
}
170172

test/message/vm_dont_display_runtime_error.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ try {
3030
filename: 'test.vm',
3131
displayErrors: false
3232
});
33-
} catch {}
33+
} catch {
34+
// Continue regardless of error
35+
}
3436

3537
console.error('middle');
3638

test/message/vm_dont_display_syntax_error.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ try {
3030
filename: 'test.vm',
3131
displayErrors: false
3232
});
33-
} catch {}
33+
} catch {
34+
// Continue regardless of error
35+
}
3436

3537
console.error('middle');
3638

test/node-api/test_fatal/test_threads.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ const test_fatal = require(`./build/${common.buildType}/test_fatal`);
88
// that crashes the process.
99
if (process.argv[2] === 'child') {
1010
test_fatal.TestThread();
11-
// Busy loop to allow the work thread to abort.
12-
while (true) {}
11+
while (true) {
12+
// Busy loop to allow the work thread to abort.
13+
}
1314
}
1415

1516
const p = child_process.spawnSync(

0 commit comments

Comments
 (0)