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

Function beChild

test/parallel/test-inspector-open.js:90–114  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

88}
89
90function beChild() {
91 const inspector = require('inspector');
92
93 process.send({ cmd: 'started' });
94
95 process.on('message', common.mustCall((msg) => {
96 if (msg.cmd === 'open') {
97 if (msg.args[0] === kFirstOpen) {
98 inspector.open(0, false, undefined);
99 } else if (msg.args[0] === kOpenWhileOpen) {
100 assert.throws(() => {
101 inspector.open(0, false, undefined);
102 }, {
103 code: 'ERR_INSPECTOR_ALREADY_ACTIVATED'
104 });
105 } else if (msg.args[0] === kReOpen) {
106 inspector.open(0, false, undefined);
107 }
108 }
109 if (msg.cmd === 'close') {
110 inspector.close();
111 }
112 process.send({ cmd: 'url', url: inspector.url() });
113 }));
114}

Callers 1

Calls 6

sendMethod · 0.65
openMethod · 0.65
closeMethod · 0.65
urlMethod · 0.65
requireFunction · 0.50
onMethod · 0.45

Tested by

no test coverage detected