Web Inspector: [regression r99960] null callback access.
authorpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Nov 2011 14:03:24 +0000 (14:03 +0000)
committerpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Nov 2011 14:03:24 +0000 (14:03 +0000)
https://bugs.webkit.org/show_bug.cgi?id=72263

Reviewed by Yury Semikhatsky.

* inspector/CodeGeneratorInspector.py:

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

Source/WebCore/ChangeLog
Source/WebCore/inspector/CodeGeneratorInspector.py

index c722233..2f5f778 100644 (file)
@@ -1,3 +1,12 @@
+2011-11-14  Pavel Feldman  <pfeldman@google.com>
+
+        Web Inspector: [regression r99960] null callback access.
+        https://bugs.webkit.org/show_bug.cgi?id=72263
+
+        Reviewed by Yury Semikhatsky.
+
+        * inspector/CodeGeneratorInspector.py:
+
 2011-11-14  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
 
         [Qt] Unbreak the build on Mac OS X
index 33b5f18..a4b8641 100644 (file)
@@ -1085,23 +1085,22 @@ InspectorBackendStub.prototype = {
             }
 
             var callback = this._callbacks[messageObject.id];
-
-            var arguments = [];
-            if (messageObject.result) {
-                var paramNames = this._replyArgs[callback.methodName];
-                if (paramNames) {
-                    for (var i = 0; i < paramNames.length; ++i)
-                        arguments.push(messageObject.result[paramNames[i]]);
+            if (callback) {
+                var argumentsArray = [];
+                if (messageObject.result) {
+                    var paramNames = this._replyArgs[callback.methodName];
+                    if (paramNames) {
+                        for (var i = 0; i < paramNames.length; ++i)
+                            argumentsArray.push(messageObject.result[paramNames[i]]);
+                    }
                 }
-            }
 
-            if (callback) {
                 var processingStartTime;
                 if (this.dumpInspectorTimeStats && callback.methodName)
                     processingStartTime = Date.now();
 
-                arguments.unshift(messageObject.error);
-                callback.apply(null, arguments);
+                argumentsArray.unshift(messageObject.error);
+                callback.apply(null, argumentsArray);
                 --this._pendingResponsesCount;
                 delete this._callbacks[messageObject.id];