Skip to content

Commit 8a42a20

Browse files
Trottruyadorno
authored andcommitted
doc: add comments to empty blocks in worker_threads text
PR-URL: #41831 Refs: https://eslint.org/docs/rules/no-empty Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
1 parent c3721fc commit 8a42a20

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

doc/api/worker_threads.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -1265,7 +1265,9 @@ import {
12651265

12661266
if (isMainThread) {
12671267
new Worker(new URL(import.meta.url));
1268-
for (let n = 0; n < 1e10; n++) {}
1268+
for (let n = 0; n < 1e10; n++) {
1269+
// Looping to simulate work.
1270+
}
12691271
} else {
12701272
// This output will be blocked by the for loop in the main thread.
12711273
console.log('foo');
@@ -1282,7 +1284,9 @@ const {
12821284

12831285
if (isMainThread) {
12841286
new Worker(__filename);
1285-
for (let n = 0; n < 1e10; n++) {}
1287+
for (let n = 0; n < 1e10; n++) {
1288+
// Looping to simulate work.
1289+
}
12861290
} else {
12871291
// This output will be blocked by the for loop in the main thread.
12881292
console.log('foo');

0 commit comments

Comments
 (0)