From 8a42a20b8a03287686605c2df52bd66fb2cab465 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 2 Feb 2022 21:42:50 -0800 Subject: [PATCH] doc: add comments to empty blocks in worker_threads text MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/41831 Refs: https://eslint.org/docs/rules/no-empty Reviewed-By: Colin Ihrig Reviewed-By: Tobias Nießen Reviewed-By: Antoine du Hamel --- doc/api/worker_threads.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/api/worker_threads.md b/doc/api/worker_threads.md index 86374d8fcc3c81..a9fd6053d9defc 100644 --- a/doc/api/worker_threads.md +++ b/doc/api/worker_threads.md @@ -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');