Skip to content

Commit

Permalink
debugger: revise async iterator usage to comply with lint rules
Browse files Browse the repository at this point in the history
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: nodejs#38847
Backport-PR-URL: nodejs#39446
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
Trott authored and foxxyz committed Oct 18, 2021
1 parent f9c6beb commit 5998510
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/internal/inspector/_inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`);
Expand Down

0 comments on commit 5998510

Please sign in to comment.