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
Backport-PR-URL: #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 14, 2022
1 parent 125ed0c commit 330c1bc
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 @@ -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 330c1bc

Please sign in to comment.