MCPcopy Index your code
hub / github.com/nodejs/node / childPrint

Method childPrint

lib/internal/debugger/inspect.js:194–222  ·  view source on GitHub ↗
(text, which)

Source from the content-addressed store, hash-verified

192
193 #stdioBuffers = { stdout: '', stderr: '' };
194 childPrint(text, which) {
195 const lines = RegExpPrototypeSymbolSplit(
196 /\r\n|\r|\n/g,
197 this.#stdioBuffers[which] + text);
198
199 this.#stdioBuffers[which] = '';
200
201 if (lines[lines.length - 1] !== '') {
202 this.#stdioBuffers[which] = ArrayPrototypePop(lines);
203 }
204
205 const textToPrint = ArrayPrototypeJoin(
206 ArrayPrototypeMap(lines, (chunk) => `< ${chunk}`),
207 '\n');
208
209 if (lines.length) {
210 this.print(textToPrint, true);
211 if (!this.paused) {
212 this.repl.displayPrompt(true);
213 }
214 }
215
216 if (StringPrototypeEndsWith(
217 textToPrint,
218 'Waiting for the debugger to disconnect...\n',
219 )) {
220 this.killChild();
221 }
222 }
223}
224
225function parseInteractiveArgs(args) {

Callers

nothing calls this directly

Calls 3

printMethod · 0.95
killChildMethod · 0.95
displayPromptMethod · 0.80

Tested by

no test coverage detected