diff options
author | Rich Trott <rtrott@gmail.com> | 2022-02-03 08:42:50 +0300 |
---|---|---|
committer | Node.js GitHub Bot <github-bot@iojs.org> | 2022-02-05 15:58:29 +0300 |
commit | ee8c2bed8bcc13b44ccfca07dd94b773b3bc943d (patch) | |
tree | 32e832125d07f3eefb5dede5e8f8cf62df5c3b04 /doc | |
parent | 8997bd8af279b532bbf61960ee0b8607cc2c5707 (diff) |
doc: add comments to empty blocks in worker_threads text
PR-URL: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/worker_threads.md | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/doc/api/worker_threads.md b/doc/api/worker_threads.md index cc098721175..d30205adfb1 100644 --- a/doc/api/worker_threads.md +++ b/doc/api/worker_threads.md @@ -1267,7 +1267,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'); @@ -1284,7 +1286,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'); |