MCPcopy Create free account
hub / github.com/nodejs/node / main

Function main

test/parallel/test-inspector-wait-for-connection.js:51–70  ·  view source on GitHub ↗
(prefix)

Source from the content-addressed store, hash-verified

49 session.disconnect();
50
51 function main(prefix) {
52 const inspector = require('inspector');
53 inspector.open(0, undefined, false);
54 process._ws = inspector.url();
55 console.log('before wait for debugger');
56 process.stdin.once('data', (data) => {
57 if (data.toString() === 'first') {
58 inspector.waitForDebugger();
59 console.log('after wait for debugger');
60 console.log('before second wait for debugger');
61 process.stdin.once('data', (data) => {
62 if (data.toString() === 'second') {
63 inspector.waitForDebugger();
64 console.log('after second wait for debugger');
65 process.exit();
66 }
67 });
68 }
69 });
70 }
71
72 // Check that inspector.waitForDebugger throws if there is no active
73 // inspector

Callers

nothing calls this directly

Calls 8

openMethod · 0.65
urlMethod · 0.65
waitForDebuggerMethod · 0.65
requireFunction · 0.50
logMethod · 0.45
onceMethod · 0.45
toStringMethod · 0.45
exitMethod · 0.45

Tested by

no test coverage detected