Skip to content

Commit 058fc93

Browse files
Trottaduh95
authored andcommitted
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: nodejs#38847 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 6ee4cbd commit 058fc93

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/internal/inspector/_inspect.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,9 @@ async function portIsFree(host, port, timeout = 9999) {
9191

9292
setTimeout(timeout).then(() => ac.abort());
9393

94-
// eslint-disable-next-line no-unused-vars
95-
for await (const _ of setInterval(retryDelay)) {
94+
const asyncIterator = setInterval(retryDelay);
95+
while (true) {
96+
await asyncIterator.next();
9697
if (signal.aborted) {
9798
throw new StartupError(
9899
`Timeout (${timeout}) waiting for ${host}:${port} to be free`);

0 commit comments

Comments
 (0)