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 d42ad64

Browse filesBrowse files
Jan KremsBridgeAR
authored andcommitted
deps: update node-inspect to v1.11.6
Highlights: * The `node-inspect` test suite passes against latest master. * Removes use of deprecated `repl.rli`. Compare: nodejs/node-inspect@v1.11.5...v1.11.6 PR-URL: #28039 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent e3f905a commit d42ad64
Copy full SHA for d42ad64

File tree

Expand file treeCollapse file tree

12 files changed

+79
-45
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

12 files changed

+79
-45
lines changed
Open diff view settings
Collapse file

‎deps/node-inspect/CHANGELOG.md‎

Copy file name to clipboardExpand all lines: deps/node-inspect/CHANGELOG.md
+8Lines changed: 8 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
### 1.11.6
2+
3+
* fix: replace the deprecated "repl.cli" with "repl" - **[@oyyd](https://github.com/oyyd)** [#66](https://github.com/nodejs/node-inspect/pull/66)
4+
- [`5c1d771`](https://github.com/nodejs/node-inspect/commit/5c1d7716523b73e26f98f4f594ee34b7daa920a0) **fix:** replace the deprecated "repl.cli" with "repl" - see: [26260](Refs: https://github.com/nodejs/node/pull/26260)
5+
* Address regressions due to changes in node - **[@jkrems](https://github.com/jkrems)** [#67](https://github.com/nodejs/node-inspect/pull/67)
6+
- [`5b3511e`](https://github.com/nodejs/node-inspect/commit/5b3511ef21d0eba8304d8b2fed33f33aae22f308) **fix:** Address regressions due to changes in node
7+
8+
19
### 1.11.5
210

311
* Fix eslint issues - **[@jkrems](https://github.com/jkrems)** [#63](https://github.com/nodejs/node-inspect/pull/63)
Collapse file

‎deps/node-inspect/lib/_inspect.js‎

Copy file name to clipboardExpand all lines: deps/node-inspect/lib/_inspect.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ class NodeInspector {
198198

199199
suspendReplWhile(fn) {
200200
if (this.repl) {
201-
this.repl.rli.pause();
201+
this.repl.pause();
202202
}
203203
this.stdin.pause();
204204
this.paused = true;
@@ -207,7 +207,7 @@ class NodeInspector {
207207
}).then(() => {
208208
this.paused = false;
209209
if (this.repl) {
210-
this.repl.rli.resume();
210+
this.repl.resume();
211211
this.repl.displayPrompt();
212212
}
213213
this.stdin.resume();
Collapse file

‎deps/node-inspect/lib/internal/inspect_repl.js‎

Copy file name to clipboardExpand all lines: deps/node-inspect/lib/internal/inspect_repl.js
+17-13Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const Path = require('path');
2525
const Repl = require('repl');
2626
const util = require('util');
2727
const vm = require('vm');
28+
const fileURLToPath = require('url').fileURLToPath;
2829

2930
const debuglog = util.debuglog('inspect');
3031

@@ -89,9 +90,12 @@ function isNativeUrl(url) {
8990
return url.replace('.js', '') in NATIVES || url === 'bootstrap_node.js';
9091
}
9192

92-
function getRelativePath(filename) {
93+
function getRelativePath(filenameOrURL) {
9394
const dir = Path.join(Path.resolve(), 'x').slice(0, -1);
9495

96+
const filename = filenameOrURL.startsWith('file://') ?
97+
fileURLToPath(filenameOrURL) : filenameOrURL;
98+
9599
// Change path to relative, if possible
96100
if (filename.indexOf(dir) === 0) {
97101
return filename.slice(dir.length);
@@ -958,38 +962,38 @@ function createRepl(inspector) {
958962

959963
get repl() {
960964
// Don't display any default messages
961-
const listeners = repl.rli.listeners('SIGINT').slice(0);
962-
repl.rli.removeAllListeners('SIGINT');
965+
const listeners = repl.listeners('SIGINT').slice(0);
966+
repl.removeAllListeners('SIGINT');
963967

964968
const oldContext = repl.context;
965969

966970
exitDebugRepl = () => {
967971
// Restore all listeners
968972
process.nextTick(() => {
969973
listeners.forEach((listener) => {
970-
repl.rli.on('SIGINT', listener);
974+
repl.on('SIGINT', listener);
971975
});
972976
});
973977

974978
// Exit debug repl
975979
repl.eval = controlEval;
976980

977981
// Swap history
978-
history.debug = repl.rli.history;
979-
repl.rli.history = history.control;
982+
history.debug = repl.history;
983+
repl.history = history.control;
980984

981985
repl.context = oldContext;
982-
repl.rli.setPrompt('debug> ');
986+
repl.setPrompt('debug> ');
983987
repl.displayPrompt();
984988

985-
repl.rli.removeListener('SIGINT', exitDebugRepl);
989+
repl.removeListener('SIGINT', exitDebugRepl);
986990
repl.removeListener('exit', exitDebugRepl);
987991

988992
exitDebugRepl = null;
989993
};
990994

991995
// Exit debug repl on SIGINT
992-
repl.rli.on('SIGINT', exitDebugRepl);
996+
repl.on('SIGINT', exitDebugRepl);
993997

994998
// Exit debug repl on repl exit
995999
repl.on('exit', exitDebugRepl);
@@ -999,10 +1003,10 @@ function createRepl(inspector) {
9991003
repl.context = {};
10001004

10011005
// Swap history
1002-
history.control = repl.rli.history;
1003-
repl.rli.history = history.debug;
1006+
history.control = repl.history;
1007+
repl.history = history.debug;
10041008

1005-
repl.rli.setPrompt('> ');
1009+
repl.setPrompt('> ');
10061010

10071011
print('Press Ctrl + C to leave debug repl');
10081012
repl.displayPrompt();
@@ -1077,7 +1081,7 @@ function createRepl(inspector) {
10771081

10781082
repl.defineCommand('interrupt', () => {
10791083
// We want this for testing purposes where sending CTRL-C can be tricky.
1080-
repl.rli.emit('SIGINT');
1084+
repl.emit('SIGINT');
10811085
});
10821086

10831087
// Init once for the initial connection
Collapse file

‎deps/node-inspect/package.json‎

Copy file name to clipboardExpand all lines: deps/node-inspect/package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-inspect",
3-
"version": "1.11.5",
3+
"version": "1.11.6",
44
"description": "Node Inspect",
55
"license": "MIT",
66
"main": "lib/_inspect.js",
Collapse file

‎deps/node-inspect/test/cli/break.test.js‎

Copy file name to clipboardExpand all lines: deps/node-inspect/test/cli/break.test.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ test('stepping through breakpoints', (t) => {
1818
.then(() => cli.waitForPrompt())
1919
.then(() => {
2020
t.match(
21-
cli.output,
22-
`break in ${script}:1`,
21+
cli.breakInfo,
22+
{ filename: script, line: 1 },
2323
'pauses in the first line of the script');
2424
t.match(
2525
cli.output,
26-
/> 1 \(function \([^)]+\) \{ const x = 10;/,
26+
/> 1 (?:\(function \([^)]+\) \{ )?const x = 10;/,
2727
'shows the source and marks the current line');
2828
})
2929
.then(() => cli.stepCommand('n'))
Collapse file

‎deps/node-inspect/test/cli/exceptions.test.js‎

Copy file name to clipboardExpand all lines: deps/node-inspect/test/cli/exceptions.test.js
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ test('break on (uncaught) exceptions', (t) => {
1717
return cli.waitForInitialBreak()
1818
.then(() => cli.waitForPrompt())
1919
.then(() => {
20-
t.match(cli.output, `break in ${script}:1`);
20+
t.match(cli.breakInfo, { filename: script, line: 1 });
2121
})
2222
// making sure it will die by default:
2323
.then(() => cli.command('c'))
@@ -28,7 +28,7 @@ test('break on (uncaught) exceptions', (t) => {
2828
.then(() => cli.stepCommand('r'))
2929
.then(() => cli.waitForInitialBreak())
3030
.then(() => {
31-
t.match(cli.output, `break in ${script}:1`);
31+
t.match(cli.breakInfo, { filename: script, line: 1 });
3232
})
3333
.then(() => cli.command('breakOnException'))
3434
.then(() => cli.stepCommand('c'))
@@ -45,7 +45,7 @@ test('break on (uncaught) exceptions', (t) => {
4545
.then(() => cli.stepCommand('r')) // also, the setting survives the restart
4646
.then(() => cli.waitForInitialBreak())
4747
.then(() => {
48-
t.match(cli.output, `break in ${script}:1`);
48+
t.match(cli.breakInfo, { filename: script, line: 1 });
4949
})
5050
.then(() => cli.stepCommand('c'))
5151
.then(() => {
@@ -57,7 +57,7 @@ test('break on (uncaught) exceptions', (t) => {
5757
.then(() => cli.stepCommand('r'))
5858
.then(() => cli.waitForInitialBreak())
5959
.then(() => {
60-
t.match(cli.output, `break in ${script}:1`);
60+
t.match(cli.breakInfo, { filename: script, line: 1 });
6161
})
6262
.then(() => cli.command('c'))
6363
// TODO: Remove FATAL ERROR once node doesn't show a FATAL ERROR anymore
Collapse file

‎deps/node-inspect/test/cli/launch.test.js‎

Copy file name to clipboardExpand all lines: deps/node-inspect/test/cli/launch.test.js
+8-8Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,23 +137,23 @@ test('run after quit / restart', (t) => {
137137
.then(() => cli.waitForPrompt())
138138
.then(() => {
139139
t.match(
140-
cli.output,
141-
`break in ${script}:1`,
140+
cli.breakInfo,
141+
{ filename: script, line: 1 },
142142
'is back at the beginning');
143143
})
144144
.then(() => cli.stepCommand('n'))
145145
.then(() => {
146146
t.match(
147-
cli.output,
148-
`break in ${script}:2`,
147+
cli.breakInfo,
148+
{ filename: script, line: 2 },
149149
'steps to the 2nd line');
150150
})
151151
.then(() => cli.stepCommand('restart'))
152152
.then(() => cli.waitForInitialBreak())
153153
.then(() => {
154154
t.match(
155-
cli.output,
156-
`break in ${script}:1`,
155+
cli.breakInfo,
156+
{ filename: script, line: 1 },
157157
'is back at the beginning');
158158
})
159159
.then(() => cli.command('kill'))
@@ -167,8 +167,8 @@ test('run after quit / restart', (t) => {
167167
.then(() => cli.waitForPrompt())
168168
.then(() => {
169169
t.match(
170-
cli.output,
171-
`break in ${script}:1`,
170+
cli.breakInfo,
171+
{ filename: script, line: 1 },
172172
'is back at the beginning');
173173
})
174174
.then(() => cli.quit())
Collapse file

‎deps/node-inspect/test/cli/low-level.test.js‎

Copy file name to clipboardExpand all lines: deps/node-inspect/test/cli/low-level.test.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ test('Debugger agent direct access', (t) => {
2424
.then(() => {
2525
t.match(
2626
cli.output,
27-
/scriptSource: '\(function \(/);
27+
/scriptSource:[ \n]*'(?:\(function \(|let x = 1)/);
2828
t.match(
2929
cli.output,
3030
/let x = 1;/);
Collapse file

‎deps/node-inspect/test/cli/preserve-breaks.test.js‎

Copy file name to clipboardExpand all lines: deps/node-inspect/test/cli/preserve-breaks.test.js
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,20 @@ test('run after quit / restart', (t) => {
3030
.then(() => cli.stepCommand('c')) // hit line 2
3131
.then(() => cli.stepCommand('c')) // hit line 3
3232
.then(() => {
33-
t.match(cli.output, `break in ${script}:3`);
33+
t.match(cli.breakInfo, { filename: script, line: 3 });
3434
})
3535
.then(() => cli.command('restart'))
3636
.then(() => cli.waitForInitialBreak())
3737
.then(() => {
38-
t.match(cli.output, `break in ${script}:1`);
38+
t.match(cli.breakInfo, { filename: script, line: 1 });
3939
})
4040
.then(() => cli.stepCommand('c'))
4141
.then(() => {
42-
t.match(cli.output, `break in ${script}:2`);
42+
t.match(cli.breakInfo, { filename: script, line: 2 });
4343
})
4444
.then(() => cli.stepCommand('c'))
4545
.then(() => {
46-
t.match(cli.output, `break in ${script}:3`);
46+
t.match(cli.breakInfo, { filename: script, line: 3 });
4747
})
4848
.then(() => cli.command('breakpoints'))
4949
.then(() => {
Collapse file

‎deps/node-inspect/test/cli/scripts.test.js‎

Copy file name to clipboardExpand all lines: deps/node-inspect/test/cli/scripts.test.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ test('list scripts', (t) => {
2424
'lists the user script');
2525
t.notMatch(
2626
cli.output,
27-
/\d+: module\.js <native>/,
27+
/\d+: buffer\.js <native>/,
2828
'omits node-internal scripts');
2929
})
3030
.then(() => cli.command('scripts(true)'))
@@ -35,7 +35,7 @@ test('list scripts', (t) => {
3535
'lists the user script');
3636
t.match(
3737
cli.output,
38-
/\d+: module\.js <native>/,
38+
/\d+: buffer\.js <native>/,
3939
'includes node-internal scripts');
4040
})
4141
.then(() => cli.quit())

0 commit comments

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