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: #41831
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 ruyadorno committed Feb 8, 2022
1 parent c3721fc commit 8a42a20
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions doc/api/worker_threads.md
Original file line number Diff line number Diff line change
Expand Up @@ -1265,7 +1265,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 @@ -1282,7 +1284,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 8a42a20

Please sign in to comment.