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

Commit

Permalink
Fixing test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
Raghav Katyal committed Sep 28, 2017
1 parent afa17ae commit 70217ca
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions src/chrome/chromeDebugAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,10 @@ export abstract class ChromeDebugAdapter implements IDebugAdapter {
const pausedScriptUrl = this._scriptsById.get(pausedScriptId).url;

const mappedUrl = this._pathTransformer.scriptParsed(pausedScriptUrl);
const normalizedMappedUrl = path.normalize(mappedUrl);
let normalizedMappedUrl: string;
if (mappedUrl !== undefined) {
normalizedMappedUrl = path.normalize(mappedUrl);
}

// If the file has unbound breakpoints, make sure to resolve them first and then decide to continue or not
if (this._pendingBreakpointsByUrl.has(normalizedMappedUrl)) {
Expand Down Expand Up @@ -665,7 +668,10 @@ export abstract class ChromeDebugAdapter implements IDebugAdapter {

const resolvePendingBPs = (source: string) => {
source = source && this.fixPathCasing(source);
const normalizedSource = path.normalize(source);
let normalizedSource: string;
if (source !== undefined) {
normalizedSource = path.normalize(source);
}

if (this._pendingBreakpointsByUrl.has(normalizedSource)) {
this.resolvePendingBreakpoint(this._pendingBreakpointsByUrl.get(normalizedSource))
Expand All @@ -674,7 +680,10 @@ export abstract class ChromeDebugAdapter implements IDebugAdapter {
};

const mappedUrl = this._pathTransformer.scriptParsed(script.url);
const normalizedMappedUrl = path.normalize(mappedUrl);
let normalizedMappedUrl: string;
if (mappedUrl !== undefined) {
normalizedMappedUrl = path.normalize(mappedUrl);
}

const sourceMapsP = this._sourceMapTransformer.scriptParsed(mappedUrl, script.sourceMapURL).then(sources => {
if (this._hasTerminated) {
Expand Down Expand Up @@ -958,7 +967,11 @@ export abstract class ChromeDebugAdapter implements IDebugAdapter {
column: params.location.columnNumber
};
const scriptPath = this._pathTransformer.breakpointResolved(bp, script.url);
const normalizedScriptPath = path.normalize(scriptPath);
let normalizedScriptPath: string;
if (scriptPath !== undefined) {
normalizedScriptPath = path.normalize(scriptPath);
}

if (this._pendingBreakpointsByUrl.has(normalizedScriptPath)) {
// If we set these BPs before the script was loaded, remove from the pending list
this._pendingBreakpointsByUrl.delete(normalizedScriptPath);
Expand Down

0 comments on commit 70217ca

Please sign in to comment.