Chromium Code Reviews| Index: Source/devtools/front_end/bindings/CompilerScriptMapping.js |
| diff --git a/Source/devtools/front_end/bindings/CompilerScriptMapping.js b/Source/devtools/front_end/bindings/CompilerScriptMapping.js |
| index bc8f8a7d6a42ba83d9de22fc5726854a0b68ca8b..20684e49d8598efad540f84995a2f7b559933768 100644 |
| --- a/Source/devtools/front_end/bindings/CompilerScriptMapping.js |
| +++ b/Source/devtools/front_end/bindings/CompilerScriptMapping.js |
| @@ -97,13 +97,12 @@ WebInspector.CompilerScriptMapping.prototype = { |
| var lineNumber = debuggerModelLocation.lineNumber; |
| var columnNumber = debuggerModelLocation.columnNumber || 0; |
| var entry = sourceMap.findEntry(lineNumber, columnNumber); |
| - if (!entry || entry.length === 2) |
| + if (!entry || !entry.sourceURL) |
| return null; |
| - var url = /** @type {string} */ (entry[2]); |
| - var uiSourceCode = this._networkMapping.uiSourceCodeForURL(url, this._target); |
| + var uiSourceCode = this._networkMapping.uiSourceCodeForURL(/** @type {string} */ (entry.sourceURL), this._target); |
| if (!uiSourceCode) |
| return null; |
| - return uiSourceCode.uiLocation(/** @type {number} */ (entry[3]), /** @type {number} */ (entry[4])); |
| + return uiSourceCode.uiLocation(/** @type {number} */ (entry.sourceLineNumber), /** @type {number} */ (entry.sourceColumnNumber)); |
| }, |
| /** |
| @@ -125,12 +124,13 @@ WebInspector.CompilerScriptMapping.prototype = { |
| return null; |
| var script = /** @type {!WebInspector.Script} */ (this._scriptForSourceMap.get(sourceMap)); |
| console.assert(script); |
| + var entry = null; |
| var mappingSearchLinesCount = 5; |
|
pfeldman
2015/09/04 01:38:36
Lets remove this.
lushnikov
2015/09/04 17:46:45
Done.
|
| - // We do not require precise (breakpoint) location but limit the number of lines to search or mapping. |
| - var entry = sourceMap.findEntryReversed(networkURL, lineNumber, mappingSearchLinesCount); |
| + for (var i = 0; i < mappingSearchLinesCount && !entry; ++i) |
| + entry = sourceMap.firstSourceLineMapping(networkURL, lineNumber + i); |
| if (!entry) |
| return null; |
| - return this._debuggerModel.createRawLocation(script, /** @type {number} */ (entry[0]), /** @type {number} */ (entry[1])); |
| + return this._debuggerModel.createRawLocation(script, entry.lineNumber, entry.columnNumber); |
| }, |
| /** |
| @@ -252,7 +252,7 @@ WebInspector.CompilerScriptMapping.prototype = { |
| var sourceMap = this._sourceMapForURL.get(networkURL); |
| if (!sourceMap) |
| return true; |
| - return !!sourceMap.findEntryReversed(networkURL, lineNumber, 0); |
| + return !!sourceMap.firstSourceLineMapping(networkURL, lineNumber); |
| }, |
| /** |