Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1199)

Unified Diff: Source/devtools/front_end/source_frame/SourceFrame.js

Issue 1312523002: DevTools: add range checks while adding console message to the SourceFrame (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: minus 1 Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/source_frame/SourceFrame.js
diff --git a/Source/devtools/front_end/source_frame/SourceFrame.js b/Source/devtools/front_end/source_frame/SourceFrame.js
index 6e9b2ba86d9d84aa08c5e2966607b490f4df4cb8..41f0c36a1617b36ac4c40ebb088ad0a310b3b9f5 100644
--- a/Source/devtools/front_end/source_frame/SourceFrame.js
+++ b/Source/devtools/front_end/source_frame/SourceFrame.js
@@ -859,7 +859,9 @@ WebInspector.SourceFrame.RowMessageBucket.prototype = {
*/
_updateWavePosition: function(lineNumber, columnNumber)
{
+ lineNumber = Math.min(lineNumber, this._textEditor.linesCount - 1);
var lineText = this._textEditor.line(lineNumber);
+ columnNumber = Math.min(columnNumber, lineText.length);
var lineIndent = WebInspector.TextUtils.lineIndent(lineText).length;
var base = this._textEditor.cursorPositionToCoordinates(lineNumber, 0);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698