| 126 | ): Promise<Cdp.Debugger.EvaluateOnCallFrameResult>; |
| 127 | public evaluate(params: Cdp.Runtime.EvaluateParams): Promise<Cdp.Runtime.EvaluateResult>; |
| 128 | public async evaluate( |
| 129 | params: Cdp.Debugger.EvaluateOnCallFrameParams | Cdp.Runtime.EvaluateParams, |
| 130 | ) { |
| 131 | // no call frame means there will not be any relevant $returnValue to reference |
| 132 | if (!('callFrameId' in params)) { |
| 133 | return this.cdp.Runtime.evaluate(params); |
| 134 | } |
| 135 | |
| 136 | return this.prepare(params.expression).invoke(params); |
| 137 | } |
| 138 | |
| 139 | /** |
| 140 | * Hoists the return value of the expression to the `globalThis`. |