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
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
Trott authored and aduh95 committed Jul 20, 2021
1 parent cc589f3 commit e036082
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 e036082

Please sign in to comment.