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
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
Trott authored and danielleadams committed Jun 2, 2021
1 parent 47ad448 commit eb7c932
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 @@ -87,8 +87,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 eb7c932

Please sign in to comment.