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

Commit

Permalink
Use less memory to save script details, for microsoft/vscode#53535
Browse files Browse the repository at this point in the history
  • Loading branch information
roblourens committed Jul 29, 2018
1 parent 946cfb9 commit afdfdd8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/chrome/chromeDebugAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -801,11 +801,18 @@ export abstract class ChromeDebugAdapter implements IDebugAdapter {
} else {
const newValue = promiseDefer<void>();
this._scriptIdToBreakpointsAreResolvedDefer.set(scriptId, newValue);
const dispose = () => this._scriptIdToBreakpointsAreResolvedDefer.delete(scriptId);
newValue.promise.then(dispose, dispose);

return newValue;
}
}

protected async onScriptParsed(script: Crdp.Debugger.ScriptParsedEvent): Promise<void> {
// The stack trace and hash can be large and the DA doesn't need it.
delete script.stackTrace;
delete script.hash;

const breakpointsAreResolvedDefer = this.getBreakpointsResolvedDefer(script.scriptId);
try {
this.doAfterProcessingSourceEvents(async () => { // This will block future 'removed' source events, until this processing has been completed
Expand Down

0 comments on commit afdfdd8

Please sign in to comment.