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

Commit

Permalink
Fix #121 - resolve pending bps that don't have sourcemaps associated
Browse files Browse the repository at this point in the history
  • Loading branch information
roblourens committed Oct 29, 2016
1 parent ec61e33 commit acea314
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/chrome/chromeDebugAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,16 +400,20 @@ export abstract class ChromeDebugAdapter implements IDebugAdapter {
this._scriptsById.set(script.scriptId, script);
this._scriptsByUrl.set(script.url, script);

const tryToResolve = source => {
if (this._pendingBreakpointsByUrl.has(source)) {
this.resolvePendingBreakpoint(this._pendingBreakpointsByUrl.get(source))
.then(() => this._pendingBreakpointsByUrl.delete(source));
}
};

const mappedUrl = this._pathTransformer.scriptParsed(script.url);
const sourceMapsP = this._sourceMapTransformer.scriptParsed(mappedUrl, script.sourceMapURL).then(sources => {
if (sources) {
sources.forEach(source => {
if (this._pendingBreakpointsByUrl.has(source)) {
this.resolvePendingBreakpoint(this._pendingBreakpointsByUrl.get(source))
.then(() => this._pendingBreakpointsByUrl.delete(source));
}
});
sources.forEach(tryToResolve);
}

tryToResolve(mappedUrl);
});

if (this._initialSourceMapsP) {
Expand Down

0 comments on commit acea314

Please sign in to comment.