From 0ef5e088c0e34391472d33d3a7398c38d04ae068 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 29 May 2021 13:58:32 -0700 Subject: [PATCH] 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 Backport-PR-URL: https://github.com/nodejs/node/pull/39446 Reviewed-By: Antoine du Hamel Reviewed-By: James M Snell --- lib/internal/inspector/_inspect.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/internal/inspector/_inspect.js b/lib/internal/inspector/_inspect.js index 528416c75aaee1..924b5a7f8a9bb9 100644 --- a/lib/internal/inspector/_inspect.js +++ b/lib/internal/inspector/_inspect.js @@ -91,8 +91,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`);