Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
Stop debugging on program end - Fix #11
Browse files Browse the repository at this point in the history
  • Loading branch information
rianadon authored and roblourens committed Jul 20, 2017
1 parent 9d5eb8b commit 26d32f3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/nodeDebugAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,16 @@ export class NodeDebugAdapter extends ChromeDebugAdapter {
this._restartMode = args.restart;
}

protected hookConnectionEvents(): void {
super.hookConnectionEvents();

this.chrome.Runtime.onExecutionContextDestroyed(params => {
if (params.executionContextId === 1) {
this.terminateSession('Program ended');
}
});
}

protected doAttach(port: number, targetUrl?: string, address?: string, timeout?: number): Promise<void> {
return super.doAttach(port, targetUrl, address, timeout)
.then(() => {
Expand Down

0 comments on commit 26d32f3

Please sign in to comment.