Skip to content

Commit

Permalink
doc: add comments to empty blocks in worker_threads text
Browse files Browse the repository at this point in the history
PR-URL: nodejs#41831
Backport-PR-URL: nodejs#42160
Refs: https://eslint.org/docs/rules/no-empty
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
  • Loading branch information
Trott authored and danielleadams committed Mar 4, 2022
1 parent b302ea1 commit 1639379
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions doc/api/worker_threads.md
Expand Up @@ -1255,7 +1255,9 @@ import {

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

if (isMainThread) {
new Worker(__filename);
for (let n = 0; n < 1e10; n++) {}
for (let n = 0; n < 1e10; n++) {
// Looping to simulate work.
}
} else {
// This output will be blocked by the for loop in the main thread.
console.log('foo');
Expand Down

0 comments on commit 1639379

Please sign in to comment.