-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
inspector: check if connected before waiting
Fixes: #10093 PR-URL: #10094 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
- Loading branch information
1 parent
19d7197
commit b41db33
Showing
2 changed files
with
21 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
'use strict'; | ||
require('../common'); | ||
const spawn = require('child_process').spawn; | ||
|
||
const child = spawn(process.execPath, | ||
[ '--inspect', 'no-such-script.js' ], | ||
{ 'stdio': 'inherit' }); | ||
|
||
function signalHandler(value) { | ||
child.kill(); | ||
process.exit(1); | ||
} | ||
|
||
process.on('SIGINT', signalHandler); | ||
process.on('SIGTERM', signalHandler); |