Skip to content

Commit 0b90b07

Browse files
Jan Kremstargos
authored andcommitted
deps: Upgrade node-inspect to 1.11.5
Removes the prompt to report a bug when trying to launch the debugger using a port that is already in use. Changeset generated via: ``` rm -rf deps/node-inspect node-inspect-* && \ curl -sSL "https://github.com/nodejs/node-inspect/archive/v1.11.5.tar.gz" | \ tar -xzvf - && mv node-inspect-* deps/node-inspect ``` PR-URL: #21055 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
1 parent c5a6559 commit 0b90b07

File tree

6 files changed

+68
-7
lines changed

6 files changed

+68
-7
lines changed

‎deps/node-inspect/.eslintrc‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ env:
55
es6: true
66

77
parserOptions:
8-
ecmaVersion: 2016
8+
ecmaVersion: 2017
99

1010
rules:
1111
# Possible Errors
@@ -139,3 +139,9 @@ globals:
139139
DTRACE_HTTP_SERVER_RESPONSE: false
140140
DTRACE_NET_SERVER_CONNECTION: false
141141
DTRACE_NET_STREAM_END: false
142+
LTTNG_HTTP_CLIENT_REQUEST: false
143+
LTTNG_HTTP_CLIENT_RESPONSE: false
144+
LTTNG_HTTP_SERVER_REQUEST: false
145+
LTTNG_HTTP_SERVER_RESPONSE: false
146+
LTTNG_NET_SERVER_CONNECTION: false
147+
LTTNG_NET_STREAM_END: false

‎deps/node-inspect/.npmrc‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
registry=https://registry.npmjs.org
2+
package-lock=false

‎deps/node-inspect/CHANGELOG.md‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
### 1.11.5
2+
3+
* Fix eslint issues - **[@jkrems](https://github.com/jkrems)**[#63](https://github.com/nodejs/node-inspect/pull/63)
4+
-[`2adadbc`](https://github.com/nodejs/node-inspect/commit/2adadbc1086d2e374c425acbf96260a122705db2)**style:** Fix eslint issues
5+
-[`a6d2f88`](https://github.com/nodejs/node-inspect/commit/a6d2f882c026409696a1b063ff40ceba7e1ddb86)**doc:** Remove redundant newline at the end
6+
7+
8+
### 1.11.4
9+
10+
* Handle blocked port - **[@jkrems](https://github.com/jkrems)**[#62](https://github.com/nodejs/node-inspect/pull/62)
11+
-[`3388969`](https://github.com/nodejs/node-inspect/commit/3388969d0032a78ff0cdb8146f170b978ec13b7b)**chore:** Disable package-lock
12+
-[`d278b23`](https://github.com/nodejs/node-inspect/commit/d278b233ae5e11a2b62d01ccbaae594f39b32a96)**fix:** Stop asking to report a blocked port - see: [#60](https://github.com/nodejs/node-inspect/issues/60)
13+
14+
115
### 1.11.3
216

317
*[`93caa0f`](https://github.com/nodejs/node-inspect/commit/93caa0f5267c7ab452b258d3b03329a0bb5ac7f7)**docs:** Add missing oc in protocol

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

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ const [ InspectClient, createRepl ] =
4242

4343
constdebuglog=util.debuglog('inspect');
4444

45+
classStartupErrorextendsError{
46+
constructor(message){
47+
super(message);
48+
this.name='StartupError';
49+
}
50+
}
51+
4552
functionportIsFree(host,port,timeout=2000){
4653
if(port===0)returnPromise.resolve();// Binding to a random port.
4754

@@ -51,7 +58,7 @@ function portIsFree(host, port, timeout = 2000){
5158
returnnewPromise((resolve,reject)=>{
5259
setTimeout(()=>{
5360
didTimeOut=true;
54-
reject(newError(
61+
reject(newStartupError(
5562
`Timeout (${timeout}) waiting for ${host}:${port} to be free`));
5663
},timeout);
5764

@@ -346,10 +353,14 @@ function startInspect(argv = process.argv.slice(2),
346353
stdin.resume();
347354

348355
functionhandleUnexpectedError(e){
349-
console.error('There was an internal error in node-inspect. '+
350-
'Please report this bug.');
351-
console.error(e.message);
352-
console.error(e.stack);
356+
if(!(einstanceofStartupError)){
357+
console.error('There was an internal error in node-inspect. '+
358+
'Please report this bug.');
359+
console.error(e.message);
360+
console.error(e.stack);
361+
}else{
362+
console.error(e.message);
363+
}
353364
if(inspector.child)inspector.child.kill();
354365
process.exit(1);
355366
}

‎deps/node-inspect/package.json‎

Lines 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.3",
3+
"version": "1.11.5",
44
"description": "Node Inspect",
55
"license": "MIT",
66
"main": "lib/_inspect.js",

‎deps/node-inspect/test/cli/invalid-args.test.js‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
'use strict';
2+
constPath=require('path');
3+
const{ createServer }=require('net');
4+
25
const{ test }=require('tap');
36

47
conststartCLI=require('./start-cli');
@@ -23,3 +26,29 @@ test('launch w/ invalid host:port', (t) =>{
2326
t.equal(code,1,'exits with non-zero exit code');
2427
});
2528
});
29+
30+
test('launch w/ unavailable port',async(t)=>{
31+
constblocker=createServer((socket)=>socket.end());
32+
constport=awaitnewPromise((resolve,reject)=>{
33+
blocker.on('error',reject);
34+
blocker.listen(0,'127.0.0.1',()=>resolve(blocker.address().port));
35+
});
36+
37+
try{
38+
constscript=Path.join('examples','three-lines.js');
39+
constcli=startCLI([`--port=${port}`,script]);
40+
constcode=awaitcli.quit();
41+
42+
t.notMatch(
43+
cli.output,
44+
'report this bug',
45+
'Omits message about reporting this as a bug');
46+
t.match(
47+
cli.output,
48+
`waiting for 127.0.0.1:${port} to be free`,
49+
'Tells the user that the port wasn\'t available');
50+
t.equal(code,1,'exits with non-zero exit code');
51+
}finally{
52+
blocker.close();
53+
}
54+
});

0 commit comments

Comments
(0)