Web Inspector: Fix new JS compiler warnings.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Nov 2012 08:55:01 +0000 (08:55 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Nov 2012 08:55:01 +0000 (08:55 +0000)
https://bugs.webkit.org/show_bug.cgi?id=102341

Patch by Eugene Klyuchnikov <eustas.bug@gmail.com> on 2012-11-15
Reviewed by Yury Semikhatsky.

New version of compiler finds new inconsistencies.

* inspector/front-end/DOMAgent.js: Replaced 2 simiar cases with loop.
* inspector/front-end/DOMBreakpointsSidebarPane.js:
Declared instance property on WebInspector.
* inspector/front-end/Script.js: Normalized parameter notation.

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

Source/WebCore/ChangeLog
Source/WebCore/inspector/front-end/DOMAgent.js
Source/WebCore/inspector/front-end/DOMBreakpointsSidebarPane.js
Source/WebCore/inspector/front-end/Script.js

index d732dbf..4fec9a8 100644 (file)
@@ -1,3 +1,17 @@
+2012-11-15  Eugene Klyuchnikov  <eustas.bug@gmail.com>
+
+        Web Inspector: Fix new JS compiler warnings.
+        https://bugs.webkit.org/show_bug.cgi?id=102341
+
+        Reviewed by Yury Semikhatsky.
+
+        New version of compiler finds new inconsistencies.
+
+        * inspector/front-end/DOMAgent.js: Replaced 2 simiar cases with loop.
+        * inspector/front-end/DOMBreakpointsSidebarPane.js:
+        Declared instance property on WebInspector.
+        * inspector/front-end/Script.js: Normalized parameter notation.
+
 2012-11-15  Kenneth Rohde Christiansen  <kenneth@webkit.org>
 
         Unreviewed build fix.
index ea6917b..ef48693 100644 (file)
@@ -1280,11 +1280,12 @@ WebInspector.DOMAgent.prototype = {
     {
         const injectedFunction = function() {
             const touchEvents = ["ontouchstart", "ontouchend", "ontouchmove", "ontouchcancel"];
+            var recepients = [window.__proto__, document.__proto__];
             for (var i = 0; i < touchEvents.length; ++i) {
-                if (!(touchEvents[i] in window.__proto__))
-                    Object.defineProperty(window.__proto__, touchEvents[i], { value: null, writable: true, configurable: true, enumerable: true });
-                if (!(touchEvents[i] in document.__proto__))
-                    Object.defineProperty(document.__proto__, touchEvents[i], { value: null, writable: true, configurable: true, enumerable: true });
+                for (var j = 0; j < recepients.length; ++j) {
+                    if (!(touchEvents[i] in recepients[j]))
+                        Object.defineProperty(recepients[j], touchEvents[i], { value: null, writable: true, configurable: true, enumerable: true });
+                }
             }
         }
 
index e977896..adbb47c 100644 (file)
@@ -327,3 +327,8 @@ WebInspector.DOMBreakpointsSidebarPane.prototype = {
 
     __proto__: WebInspector.NativeBreakpointsSidebarPane.prototype
 }
+
+/**
+ * @type {?WebInspector.DOMBreakpointsSidebarPane}
+ */
+WebInspector.domBreakpointsSidebarPane = null;
index e794477..8c80ba0 100644 (file)
@@ -137,7 +137,7 @@ WebInspector.Script.prototype = {
         /**
          * @this {WebInspector.Script}
          * @param {?Protocol.Error} error
-         * @param {Array.<DebuggerAgent.CallFrame>|undefined} callFrames
+         * @param {Array.<DebuggerAgent.CallFrame>=} callFrames
          * @param {Object=} debugData
          */
         function didEditScriptSource(error, callFrames, debugData)