(expr, style)
| 406 | } |
| 407 | |
| 408 | function 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 | |
| 427 | function printCommand(rest) { |
| 428 | var [expr, style] = splitPrintOptions(rest, {pretty: options.pretty}); |
no test coverage detected