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: https://github.com/nodejs/node/pull/38847
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Rich Trott committed 2021-06-01 19:46:52 -07:00
1 parent 5d9fd768f0
commit fc264dfd8d
1 file changed
+3 -2
+3 -2
View File
@@ -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`);