Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2021-05-29 23:58:32 +0300
committerRich Trott <rtrott@gmail.com>2021-06-02 05:46:52 +0300
commitfc264dfd8d3e9c8d2aabf932369a80b5de69ca26 (patch)
tree642abb025cd5fc3bd3de3ce03415c686f2c32a86 /lib
parent5d9fd768f050b38e1ddd4c9a965fe7344e1f5a04 (diff)
debugger: revise async iterator usage to comply with lint rules
I'm not sure that this is any clearer than the existing code, but I don't think it's significantly less clear, and it avoids comment disabling a lint rule. PR-URL: https://github.com/nodejs/node/pull/38847 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/internal/inspector/_inspect.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/internal/inspector/_inspect.js b/lib/internal/inspector/_inspect.js
index 89e3def1929..427469b4a6f 100644
--- a/lib/internal/inspector/_inspect.js
+++ b/lib/internal/inspector/_inspect.js
@@ -87,8 +87,9 @@ async function portIsFree(host, port, timeout = 9999) {
setTimeout(timeout).then(() => ac.abort());
- // eslint-disable-next-line no-unused-vars
- for await (const _ of setInterval(retryDelay)) {
+ const asyncIterator = setInterval(retryDelay);
+ while (true) {
+ await asyncIterator.next();
if (signal.aborted) {
throw new StartupError(
`Timeout (${timeout}) waiting for ${host}:${port} to be free`);