Skip to content

Commit 330c1bc

Browse files
Trottdanielleadams
authored andcommitted
doc: add comments to empty blocks in worker_threads text
PR-URL: #41831 Backport-PR-URL: #42160 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 125ed0c commit 330c1bc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

doc/api/worker_threads.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,7 +1255,9 @@ import {
12551255

12561256
if (isMainThread) {
12571257
new Worker(new URL(import.meta.url));
1258-
for (let n = 0; n < 1e10; n++) {}
1258+
for (let n = 0; n < 1e10; n++) {
1259+
// Looping to simulate work.
1260+
}
12591261
} else {
12601262
// This output will be blocked by the for loop in the main thread.
12611263
console.log('foo');
@@ -1272,7 +1274,9 @@ const {
12721274

12731275
if (isMainThread) {
12741276
new Worker(__filename);
1275-
for (let n = 0; n < 1e10; n++) {}
1277+
for (let n = 0; n < 1e10; n++) {
1278+
// Looping to simulate work.
1279+
}
12761280
} else {
12771281
// This output will be blocked by the for loop in the main thread.
12781282
console.log('foo');

0 commit comments

Comments
 (0)