forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
src: initialize inspector before RunBootstrapping()
This is necessary for `--inspect-brk-node` to work, and for the inspector to be aware of scripts created before bootstrapping. Fixes: nodejs#32648 Refs: nodejs#30467 (comment)
- Loading branch information
Showing
3 changed files
with
67 additions
and
35 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
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,28 @@ | ||
'use strict'; | ||
const common = require('../common'); | ||
|
||
// Regression test for https://github.com/nodejs/node/issues/32648 | ||
|
||
common.skipIfInspectorDisabled(); | ||
|
||
const { NodeInstance } = require('../common/inspector-helper.js'); | ||
|
||
async function runTest() { | ||
const child = new NodeInstance(['--inspect-brk-node=0', '-p', '42']); | ||
const session = await child.connectInspectorSession(); | ||
await session.send({ method: 'Runtime.enable' }); | ||
await session.send({ method: 'Debugger.enable' }); | ||
await session.send({ method: 'Runtime.runIfWaitingForDebugger' }); | ||
await session.waitForNotification((notification) => { | ||
// The main assertion here is that we do hit the loader script first. | ||
return notification.method === 'Debugger.scriptParsed' && | ||
notification.params.url === 'internal/bootstrap/loaders.js'; | ||
}); | ||
|
||
await session.waitForNotification('Debugger.paused'); | ||
await session.send({ method: 'Debugger.resume' }); | ||
await session.waitForNotification('Debugger.paused'); | ||
await session.runToCompletion(); | ||
} | ||
|
||
runTest().then(common.mustCall()); |