MCPcopy Create free account
hub / github.com/GNOME/gjs / doPrint

Function doPrint

modules/script/_bootstrap/debugger.js:408–425  ·  view source on GitHub ↗
(expr, style)

Source from the content-addressed store, hash-verified

406}
407
408function doPrint(expr, style) {
409 // This is the real deal.
410 expr = `(${expr})`;
411 const cv = saveExcursion(
412 () => focusedFrame === null
413 ? debuggeeGlobalWrapper.executeInGlobalWithBindings(expr, debuggeeValues)
414 : focusedFrame.evalWithBindings(expr, debuggeeValues));
415
416 if (cv === null) {
417 print('Debuggee died.');
418 } else if ('return' in cv) {
419 showDebuggeeValue(cv['return'], style);
420 } else {
421 print("Exception caught. (To rethrow it, type 'throw'.)");
422 lastExc = cv.throw;
423 showDebuggeeValue(lastExc, style);
424 }
425}
426
427function printCommand(rest) {
428 var [expr, style] = splitPrintOptions(rest, {pretty: options.pretty});

Callers 1

printCommandFunction · 0.85

Calls 2

saveExcursionFunction · 0.85
showDebuggeeValueFunction · 0.85

Tested by

no test coverage detected