diff --git a/src/chromeDebugAdapter.ts b/src/chromeDebugAdapter.ts index ec3ddc1..87a4f0c 100644 --- a/src/chromeDebugAdapter.ts +++ b/src/chromeDebugAdapter.ts @@ -279,7 +279,7 @@ export function resolveWebRootPattern(webRoot: string, sourceMapPathOverrides: I for (let pattern in sourceMapPathOverrides) { const replacePattern = replaceWebRootInSourceMapPathOverridesEntry(webRoot, pattern, warnOnMissing); const replacePatternValue = replaceWebRootInSourceMapPathOverridesEntry(webRoot, sourceMapPathOverrides[pattern], warnOnMissing); - + resolvedOverrides[replacePattern] = replacePatternValue; } @@ -297,10 +297,10 @@ function replaceWebRootInSourceMapPathOverridesEntry(webRoot: string, entry: str } else if (webRootIndex > 0) { logger.log('Warning: in a sourceMapPathOverrides entry, ${webRoot} is only valid at the beginning of the path'); } - + return entry; -} - +} + function getChromeSpawnHelperPath(): string { if (path.basename(__dirname) === 'src') { // For tests diff --git a/test/chromeDebugAdapter.test.ts b/test/chromeDebugAdapter.test.ts index 74608d9..ff55c5e 100644 --- a/test/chromeDebugAdapter.test.ts +++ b/test/chromeDebugAdapter.test.ts @@ -138,7 +138,7 @@ suite('ChromeDebugAdapter', () => { { '/src': WEBROOT + '/app/src' }); assert.deepEqual( resolveWebRootPattern(WEBROOT, { '${webRoot}/src': '${webRoot}/app/src'}), - { WEBROOT + '/src': WEBROOT + '/app/src' }); + { [WEBROOT + '/src']: WEBROOT + '/app/src'}); }); test(`ignores the webRoot pattern when it's not at the beginning of the string`, () => { @@ -162,7 +162,7 @@ suite('ChromeDebugAdapter', () => { '*/app.js': '*/app.js', '/src/app.js': '/src/${webRoot}', '/app.js': WEBROOT + '/app.js', - WEBROOT + '/app1.js': WEBROOT + '/app.js' + [WEBROOT + '/app1.js']: WEBROOT + '/app.js' }; assert.deepEqual(