| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 var columnBreakpoints = lineBreakpoints ? lineBreakpoints.get(columnNumber)
: null; | 259 var columnBreakpoints = lineBreakpoints ? lineBreakpoints.get(columnNumber)
: null; |
| 260 return columnBreakpoints ? columnBreakpoints[0] : null; | 260 return columnBreakpoints ? columnBreakpoints[0] : null; |
| 261 } | 261 } |
| 262 | 262 |
| 263 /** | 263 /** |
| 264 * @param {!Workspace.UISourceCode} uiSourceCode | 264 * @param {!Workspace.UISourceCode} uiSourceCode |
| 265 * @param {!TextUtils.TextRange} textRange | 265 * @param {!TextUtils.TextRange} textRange |
| 266 * @return {!Promise<!Array<!Workspace.UILocation>>} | 266 * @return {!Promise<!Array<!Workspace.UILocation>>} |
| 267 */ | 267 */ |
| 268 possibleBreakpoints(uiSourceCode, textRange) { | 268 possibleBreakpoints(uiSourceCode, textRange) { |
| 269 var startLocations = Bindings.debuggerWorkspaceBinding.uiLocationToRawLocati
ons( | 269 var startLocation = Bindings.debuggerWorkspaceBinding.uiLocationToRawLocatio
n( |
| 270 uiSourceCode, textRange.startLine, textRange.startColumn); | 270 uiSourceCode, textRange.startLine, textRange.startColumn); |
| 271 var endLocations = Bindings.debuggerWorkspaceBinding.uiLocationToRawLocation
s( | 271 var endLocation = |
| 272 uiSourceCode, textRange.endLine, textRange.endColumn); | 272 Bindings.debuggerWorkspaceBinding.uiLocationToRawLocation(uiSourceCode,
textRange.endLine, textRange.endColumn); |
| 273 var startLocationsByScript = new Map(startLocations.map(location => [locatio
n.script(), location])); | 273 if (!startLocation || !endLocation || startLocation.debuggerModel !== endLoc
ation.debuggerModel) |
| 274 var endLocation = endLocations.find(location => location.script() && startLo
cationsByScript.get(location.script())); | |
| 275 if (!endLocation) | |
| 276 return Promise.resolve([]); | 274 return Promise.resolve([]); |
| 277 var startLocation = startLocationsByScript.get(endLocation.script()); | 275 |
| 278 return startLocation.debuggerModel | 276 return startLocation.debuggerModel |
| 279 .getPossibleBreakpoints(startLocation, endLocation, /* restrictToFunctio
n */ false) | 277 .getPossibleBreakpoints(startLocation, endLocation, /* restrictToFunctio
n */ false) |
| 280 .then(toUILocations.bind(this)); | 278 .then(toUILocations.bind(this)); |
| 281 | 279 |
| 282 /** | 280 /** |
| 283 * @this {!Bindings.BreakpointManager} | 281 * @this {!Bindings.BreakpointManager} |
| 284 * @param {!Array<!SDK.DebuggerModel.BreakLocation>} locations | 282 * @param {!Array<!SDK.DebuggerModel.BreakLocation>} locations |
| 285 * @return {!Array<!Workspace.UILocation>} | 283 * @return {!Array<!Workspace.UILocation>} |
| 286 */ | 284 */ |
| 287 function toUILocations(locations) { | 285 function toUILocations(locations) { |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 804 callback(); | 802 callback(); |
| 805 return; | 803 return; |
| 806 } | 804 } |
| 807 | 805 |
| 808 var uiSourceCode = this._breakpoint.uiSourceCode(); | 806 var uiSourceCode = this._breakpoint.uiSourceCode(); |
| 809 var lineNumber = this._breakpoint._lineNumber; | 807 var lineNumber = this._breakpoint._lineNumber; |
| 810 var columnNumber = this._breakpoint._columnNumber; | 808 var columnNumber = this._breakpoint._columnNumber; |
| 811 var condition = this._breakpoint.condition(); | 809 var condition = this._breakpoint.condition(); |
| 812 | 810 |
| 813 var debuggerLocation = uiSourceCode && | 811 var debuggerLocation = uiSourceCode && |
| 814 Bindings.debuggerWorkspaceBinding.uiLocationToRawLocations(uiSourceCode,
lineNumber, columnNumber)[0]; | 812 Bindings.debuggerWorkspaceBinding.uiLocationToRawLocation(uiSourceCode,
lineNumber, columnNumber); |
| 815 var newState; | 813 var newState; |
| 816 if (this._breakpoint._isRemoved || !this._breakpoint.enabled() || this._scri
ptDiverged()) { | 814 if (this._breakpoint._isRemoved || !this._breakpoint.enabled() || this._scri
ptDiverged()) { |
| 817 newState = null; | 815 newState = null; |
| 818 } else if (debuggerLocation) { | 816 } else if (debuggerLocation) { |
| 819 var script = debuggerLocation.script(); | 817 var script = debuggerLocation.script(); |
| 820 if (script.sourceURL) { | 818 if (script.sourceURL) { |
| 821 newState = new Bindings.BreakpointManager.Breakpoint.State( | 819 newState = new Bindings.BreakpointManager.Breakpoint.State( |
| 822 script.sourceURL, null, debuggerLocation.lineNumber, debuggerLocatio
n.columnNumber, condition); | 820 script.sourceURL, null, debuggerLocation.lineNumber, debuggerLocatio
n.columnNumber, condition); |
| 823 } else { | 821 } else { |
| 824 newState = new Bindings.BreakpointManager.Breakpoint.State( | 822 newState = new Bindings.BreakpointManager.Breakpoint.State( |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1082 this.url = breakpoint._url; | 1080 this.url = breakpoint._url; |
| 1083 this.lineNumber = breakpoint.lineNumber(); | 1081 this.lineNumber = breakpoint.lineNumber(); |
| 1084 this.columnNumber = breakpoint.columnNumber(); | 1082 this.columnNumber = breakpoint.columnNumber(); |
| 1085 this.condition = breakpoint.condition(); | 1083 this.condition = breakpoint.condition(); |
| 1086 this.enabled = breakpoint.enabled(); | 1084 this.enabled = breakpoint.enabled(); |
| 1087 } | 1085 } |
| 1088 }; | 1086 }; |
| 1089 | 1087 |
| 1090 /** @type {!Bindings.BreakpointManager} */ | 1088 /** @type {!Bindings.BreakpointManager} */ |
| 1091 Bindings.breakpointManager; | 1089 Bindings.breakpointManager; |
| OLD | NEW |