(
responsePromise:
| Promise<Cdp.Runtime.EvaluateResult | undefined>
| Promise<Cdp.Debugger.EvaluateOnCallFrameResult | undefined>,
)
| 433 | } |
| 434 | |
| 435 | async _evaluateRepl( |
| 436 | responsePromise: |
| 437 | | Promise<Cdp.Runtime.EvaluateResult | undefined> |
| 438 | | Promise<Cdp.Debugger.EvaluateOnCallFrameResult | undefined>, |
| 439 | ): Promise<Dap.EvaluateResult | Dap.Error> { |
| 440 | const response = await responsePromise; |
| 441 | if (!response) return { result: '', variablesReference: 0 }; |
| 442 | |
| 443 | if (response.exceptionDetails) { |
| 444 | const formattedException = await this._formatException(response.exceptionDetails); |
| 445 | throw new errors.ProtocolError(errors.replError(formattedException.output)); |
| 446 | } else { |
| 447 | const contextName = |
| 448 | this._selectedContext && this.defaultExecutionContext() !== this._selectedContext |
| 449 | ? `\x1b[33m[${this._delegate.executionContextName(this._selectedContext.description)}] ` |
| 450 | : ''; |
| 451 | const resultVar = await this.replVariables.createVariable(response.result, 'repl'); |
| 452 | return { |
| 453 | variablesReference: resultVar.variablesReference, |
| 454 | result: `${contextName}${resultVar.value}`, |
| 455 | }; |
| 456 | } |
| 457 | } |
| 458 | |
| 459 | private _initialize() { |
| 460 | this._cdp.Runtime.on('executionContextCreated', event => { |
no test coverage detected