Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0f65e41

Browse filesBrowse files
Trotttargos
authored andcommitted
debugger: reduce scope of eslint disable comment
Current code masks setInterval and setTimeout with promisified versions. This can be confusing to read and causes lint errors. Replace masking with use of pSetInterval and pSetTimeout instead. Move disabling of lint rule from entire file to the one remaining line (after the above changes) that still needs it. PR-URL: #38946 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent f40725f commit 0f65e41
Copy full SHA for 0f65e41

File tree

Expand file treeCollapse file tree

1 file changed

+6
-9
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-9
lines changed
Open diff view settings
Collapse file

‎lib/internal/inspector/_inspect.js‎

Copy file name to clipboardExpand all lines: lib/internal/inspector/_inspect.js
+6-9Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020
* IN THE SOFTWARE.
2121
*/
2222

23-
// TODO(aduh95): remove restricted syntax errors
24-
/* eslint-disable no-restricted-syntax */
25-
2623
'use strict';
2724

2825
const {
@@ -53,8 +50,8 @@ const { EventEmitter } = require('events');
5350
const net = require('net');
5451
const util = require('util');
5552
const {
56-
setInterval,
57-
setTimeout,
53+
setInterval: pSetInterval,
54+
setTimeout: pSetTimeout,
5855
} = require('timers/promises');
5956
const {
6057
AbortController,
@@ -85,13 +82,13 @@ async function portIsFree(host, port, timeout = 9999) {
8582
const ac = new AbortController();
8683
const { signal } = ac;
8784

88-
setTimeout(timeout).then(() => ac.abort());
85+
pSetTimeout(timeout).then(() => ac.abort());
8986

90-
const asyncIterator = setInterval(retryDelay);
87+
const asyncIterator = pSetInterval(retryDelay);
9188
while (true) {
9289
await asyncIterator.next();
9390
if (signal.aborted) {
94-
throw new StartupError(
91+
throw new StartupError( // eslint-disable-line no-restricted-syntax
9592
`Timeout (${timeout}) waiting for ${host}:${port} to be free`);
9693
}
9794
const error = await new Promise((resolve) => {
@@ -251,7 +248,7 @@ class NodeInspector {
251248
return;
252249
} catch (error) {
253250
debuglog('connect failed', error);
254-
await setTimeout(1000);
251+
await pSetTimeout(1000);
255252
}
256253
}
257254
this.stdout.write(' failed to connect, please retry\n');

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.