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: #38847
Backport-PR-URL: #39446
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
Trott authored and richardlau committed Jul 22, 2021
1 parent 79bfb04 commit 0ef5e08
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 0ef5e08

Please sign in to comment.