DevTools: add range checks while adding console message to the SourceFrame

As the liveEdit happens, we ideally need to update uiLocation of the error
to the actual new script. However, this is a tedious task to do, so we
would simply defend againt exceptions thrown in UI.

R=pfeldman
NOTRY=true

Review URL: https://codereview.chromium.org/1312523002

git-svn-id: svn://svn.chromium.org/blink/trunk@201047 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent ec09b807
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment