()
| 457 | } |
| 458 | |
| 459 | private _initialize() { |
| 460 | this._cdp.Runtime.on('executionContextCreated', event => { |
| 461 | this._executionContextCreated(event.context); |
| 462 | }); |
| 463 | this._cdp.Runtime.on('executionContextDestroyed', event => { |
| 464 | this._executionContextDestroyed(event.executionContextId); |
| 465 | }); |
| 466 | this._cdp.Runtime.on('executionContextsCleared', () => { |
| 467 | this._ensureDebuggerEnabledAndRefreshDebuggerId(); |
| 468 | this.replVariables.clear(); |
| 469 | this._executionContextsCleared(); |
| 470 | }); |
| 471 | if (this.launchConfig.outputCapture === OutputSource.Console) { |
| 472 | this._cdp.Runtime.on('consoleAPICalled', async event => { |
| 473 | const slot = this._claimOutputSlot(); |
| 474 | slot(await this._onConsoleMessage(event)); |
| 475 | }); |
| 476 | } |
| 477 | this._cdp.Runtime.on('exceptionThrown', async event => { |
| 478 | const slot = this._claimOutputSlot(); |
| 479 | slot(await this._formatException(event.exceptionDetails)); |
| 480 | }); |
| 481 | this._cdp.Runtime.on('inspectRequested', event => { |
| 482 | if (event.hints['copyToClipboard']) this._copyObjectToClipboard(event.object); |
| 483 | else if (event.hints['queryObjects']) this._queryObjects(event.object); |
| 484 | else this._revealObject(event.object); |
| 485 | }); |
| 486 | this._cdp.Runtime.enable({}); |
| 487 | this._cdp.Network.enable({}); |
| 488 | |
| 489 | this._cdp.Debugger.on('paused', async event => this._onPaused(event)); |
| 490 | this._cdp.Debugger.on('resumed', () => this.onResumed()); |
| 491 | this._cdp.Debugger.on('scriptParsed', event => this._onScriptParsed(event)); |
| 492 | |
| 493 | this._ensureDebuggerEnabledAndRefreshDebuggerId(); |
| 494 | this._delegate.initialize(); |
| 495 | this._pauseOnScheduledAsyncCall(); |
| 496 | |
| 497 | this._dap.with(dap => |
| 498 | dap.thread({ |
| 499 | reason: 'started', |
| 500 | threadId: this.id, |
| 501 | }), |
| 502 | ); |
| 503 | } |
| 504 | |
| 505 | dapInitialized() { |
| 506 | this._dap.resolve(); |
no test coverage detected