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 <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Rich Trott 2021-05-29 13:58:32 -07:00 committed by Richard Lau
parent 79bfb0416b
commit 0ef5e088c0
No known key found for this signature in database
GPG Key ID: C43CEC45C17AB93C

View File

@ -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`);