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 <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Trott authored and ruyadorno committed Feb 8, 2022

Verified

This commit was signed with the committer’s verified signature.
ruyadorno Ruy Adorno
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
@@ -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');
@@ -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');

0 comments on commit 8a42a20

Please sign in to comment.