Web Inspector: fix SourceFrame.js compilation warning
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Mar 2013 14:59:52 +0000 (14:59 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Mar 2013 14:59:52 +0000 (14:59 +0000)
https://bugs.webkit.org/show_bug.cgi?id=112804

Patch by Andrey Lushnikov <lushnikov@chromium.org> on 2013-03-20
Reviewed by Yury Semikhatsky.

No new tests: no change in behavior.

- Explicitly parse lineNumber from object property name.
- Add type annotations to ensure addMessageToSource is monomorphic.

* inspector/front-end/SourceFrame.js:
(WebInspector.SourceFrame.prototype.clearMessages):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@146345 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/inspector/front-end/SourceFrame.js

index 8eb65f0..62f1998 100644 (file)
@@ -1,3 +1,18 @@
+2013-03-20  Andrey Lushnikov  <lushnikov@chromium.org>
+
+        Web Inspector: fix SourceFrame.js compilation warning
+        https://bugs.webkit.org/show_bug.cgi?id=112804
+
+        Reviewed by Yury Semikhatsky.
+
+        No new tests: no change in behavior.
+
+        - Explicitly parse lineNumber from object property name.
+        - Add type annotations to ensure addMessageToSource is monomorphic.
+
+        * inspector/front-end/SourceFrame.js:
+        (WebInspector.SourceFrame.prototype.clearMessages):
+
 2013-03-20  Dan Carney  <dcarney@google.com>
 
         [v8] unsafe persistent access in V8LazyEventListener
index ceebb9c..e3bfee2 100644 (file)
@@ -169,7 +169,8 @@ WebInspector.SourceFrame.prototype = {
     {
         for (var line in this._messageBubbles) {
             var bubble = this._messageBubbles[line];
-            this._textEditor.removeDecoration(line, bubble);
+            var lineNumber = parseInt(line, 10);
+            this._textEditor.removeDecoration(lineNumber, bubble);
         }
 
         this._messages = [];
@@ -500,6 +501,10 @@ WebInspector.SourceFrame.prototype = {
             this.addMessageToSource(this._messages[i].line - 1, this._messages[i]);
     },
 
+    /**
+     * @param {number} lineNumber
+     * @param {WebInspector.ConsoleMessage} msg
+     */
     addMessageToSource: function(lineNumber, msg)
     {
         if (lineNumber >= this._textEditor.linesCount)
@@ -576,6 +581,10 @@ WebInspector.SourceFrame.prototype = {
         rowMessage.repeatCountElement.textContent = WebInspector.UIString(" (repeated %d times)", rowMessage.repeatCount);
     },
 
+    /**
+     * @param {number} lineNumber
+     * @param {WebInspector.ConsoleMessage} msg
+     */
     removeMessageFromSource: function(lineNumber, msg)
     {
         if (lineNumber >= this._textEditor.linesCount)