Skip to content
This repository has been archived by the owner on Oct 2, 2021. It is now read-only.

Clearing the context immediately to avoid sending multiple remove eve… #318

Merged
merged 1 commit into from Apr 2, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/chrome/chromeDebugAdapter.ts
Expand Up @@ -533,13 +533,12 @@ export abstract class ChromeDebugAdapter implements IDebugAdapter {
*/
protected onExecutionContextsCleared(): Promise<void> {
const cachedScriptParsedEvents = Array.from(this._scriptsById.values());
this.clearTargetContext();
return this.doAfterProcessingSourceEvents(async () => { // This will not execute until all the on-flight 'new' source events have been processed
for (let scriptedParseEvent of cachedScriptParsedEvents) {
const scriptEvent = await this.scriptToLoadedSourceEvent('removed', scriptedParseEvent);
this._session.sendEvent(scriptEvent);
}

this.clearTargetContext();
});
}

Expand Down