Web Inspector: fix closure compilation warnings caused by setVariableValue change
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Feb 2013 17:52:04 +0000 (17:52 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Feb 2013 17:52:04 +0000 (17:52 +0000)
https://bugs.webkit.org/show_bug.cgi?id=109488

Patch by Peter Rybin <prybin@chromium.org> on 2013-02-14
Reviewed by Pavel Feldman.

Annotations are fixed as required by closure compiler.
Parameters in Inspector.json are reordered as required.

* inspector/InjectedScriptExterns.js:
(InjectedScriptHost.prototype.setFunctionVariableValue):
(JavaScriptCallFrame.prototype.setVariableValue):
* inspector/InjectedScriptSource.js:
(.):
* inspector/Inspector.json:
* inspector/InspectorDebuggerAgent.cpp:
(WebCore::InspectorDebuggerAgent::setVariableValue):
* inspector/InspectorDebuggerAgent.h:
(InspectorDebuggerAgent):

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

Source/WebCore/ChangeLog
Source/WebCore/inspector/InjectedScriptExterns.js
Source/WebCore/inspector/InjectedScriptSource.js
Source/WebCore/inspector/Inspector.json
Source/WebCore/inspector/InspectorDebuggerAgent.cpp
Source/WebCore/inspector/InspectorDebuggerAgent.h

index a515210e88a4164bad61f4945bc46ee4c773dc8f..994a79cc0b8c59ea2e4221ae7f7c5b06359c89b9 100644 (file)
@@ -1,3 +1,24 @@
+2013-02-14  Peter Rybin  <prybin@chromium.org>
+
+        Web Inspector: fix closure compilation warnings caused by setVariableValue change
+        https://bugs.webkit.org/show_bug.cgi?id=109488
+
+        Reviewed by Pavel Feldman.
+
+        Annotations are fixed as required by closure compiler.
+        Parameters in Inspector.json are reordered as required.
+
+        * inspector/InjectedScriptExterns.js:
+        (InjectedScriptHost.prototype.setFunctionVariableValue):
+        (JavaScriptCallFrame.prototype.setVariableValue):
+        * inspector/InjectedScriptSource.js:
+        (.):
+        * inspector/Inspector.json:
+        * inspector/InspectorDebuggerAgent.cpp:
+        (WebCore::InspectorDebuggerAgent::setVariableValue):
+        * inspector/InspectorDebuggerAgent.h:
+        (InspectorDebuggerAgent):
+
 2013-02-14  Tommy Widenflycht  <tommyw@google.com>
 
         MediaStream API: RTCDataChannel triggers a use-after-free
index 436bdd03f08b972d66fe0049b8837c673d80bdb7..23456f0e14e3d5ff57eecaeaa2c927f190113dae 100644 (file)
@@ -82,6 +82,14 @@ InjectedScriptHost.prototype.getEventListeners = function(object) { }
  */
 InjectedScriptHost.prototype.evaluate = function(expression) { }
 
+/**
+ * @param {function(...)} fun
+ * @param {number} scopeNumber
+ * @param {string} variableName
+ * @param {*} newValue
+ */
+InjectedScriptHost.prototype.setFunctionVariableValue = function(fun, scopeNumber, variableName, newValue) {}
+
 
 /**
  * @constructor
@@ -105,6 +113,13 @@ JavaScriptCallFrame.prototype.scopeType = function(index) { }
 
 JavaScriptCallFrame.prototype.restart = function() { }
 
+/**
+ * @param {number} scopeNumber
+ * @param {string} variableName
+ * @param {*} newValue
+ */
+JavaScriptCallFrame.prototype.setVariableValue = function(scopeNumber, variableName, newValue) {}
+
 /**
  * @constructor
  */
index 91eb1e27b0d96161f72b0d514c04f7646d99007f..f3afc3145486e6de4ede4cea77ccd8e4e03d270f 100644 (file)
@@ -596,7 +596,7 @@ InjectedScript.prototype = {
      * @param {Object} topCallFrame
      * @param {string|boolean} callFrameId or false
      * @param {string|boolean} functionObjectId or false
-     * @param {integer} scopeNumber
+     * @param {number} scopeNumber
      * @param {string} variableName
      * @param {string} newValueJsonString RuntimeAgent.CallArgument structure serialized as string 
      * @return {string|undefined} undefined if success or an error message 
@@ -605,12 +605,12 @@ InjectedScript.prototype = {
     {   
         var setter;
         if (callFrameId) {
-            var callFrame = this._callFrameForId(topCallFrame, callFrameId);
+            var callFrame = this._callFrameForId(topCallFrame, String(callFrameId));
             if (!callFrame)
                 return "Could not find call frame with given id";
             setter = callFrame.setVariableValue.bind(callFrame);    
         } else {
-            var parsedFunctionId = this._parseObjectId(functionObjectId);
+            var parsedFunctionId = this._parseObjectId(String(functionObjectId));
             var func = this._objectForId(parsedFunctionId);
             if (typeof func !== "function")
                 return "Cannot resolve function by id.";
index f5146b9e1ee0248bf6ec0ba23014e6173295f396..055b63779a557e240675b55b6e5a4836f4eaf3f0 100644 (file)
             {
                 "name": "setVariableValue",
                 "parameters": [
-                    { "name": "callFrameId", "$ref": "CallFrameId", "optional": true, "description": "Id of callframe that holds variable." },
-                    { "name": "functionObjectId", "$ref": "Runtime.RemoteObjectId", "optional": true, "description": "Object id of closure (function) that holds variable." },
                     { "name": "scopeNumber", "type": "integer", "description": "0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually." },
                     { "name": "variableName", "type": "string", "description": "Variable name." },
-                    { "name": "newValue", "$ref": "Runtime.CallArgument", "description": "New variable value." }
+                    { "name": "newValue", "$ref": "Runtime.CallArgument", "description": "New variable value." },
+                    { "name": "callFrameId", "$ref": "CallFrameId", "optional": true, "description": "Id of callframe that holds variable." },
+                    { "name": "functionObjectId", "$ref": "Runtime.RemoteObjectId", "optional": true, "description": "Object id of closure (function) that holds variable." }
                 ],
                 "hidden": true,
                 "description": "Changes value of variable in a callframe or a closure. Either callframe or function must be specified. Object-based scopes are not supported and must be mutated manually."
index 37fce5b383b7f468fa4f45d8062a442bcf5d339f..0252609a816ca4c1052791d8f6803715c9fceabb 100644 (file)
@@ -580,7 +580,7 @@ void InspectorDebuggerAgent::setOverlayMessage(ErrorString*, const String*)
 {
 }
 
-void InspectorDebuggerAgent::setVariableValue(ErrorString* errorString, const String* callFrameId, const String* functionObjectId, int scopeNumber, const String& variableName, const RefPtr<InspectorObject>& newValue)
+void InspectorDebuggerAgent::setVariableValue(ErrorString* errorString, int scopeNumber, const String& variableName, const RefPtr<InspectorObject>& newValue, const String* callFrameId, const String* functionObjectId)
 {
     InjectedScript injectedScript;
     if (callFrameId) {
index 7486d19ca1e2cc9573bfde7d7b8d1398b914ee56..cd9891948c33cbd60785e2fa2511ddc3c5e2c1c7 100644 (file)
@@ -113,7 +113,7 @@ public:
     void compileScript(ErrorString*, const String& expression, const String& sourceURL, TypeBuilder::OptOutput<TypeBuilder::Debugger::ScriptId>*, TypeBuilder::OptOutput<String>* syntaxErrorMessage);
     void runScript(ErrorString*, const TypeBuilder::Debugger::ScriptId&, const int* executionContextId, const String* objectGroup, const bool* doNotPauseOnExceptionsAndMuteConsole, RefPtr<TypeBuilder::Runtime::RemoteObject>& result, TypeBuilder::OptOutput<bool>* wasThrown);
     virtual void setOverlayMessage(ErrorString*, const String*);
-    virtual void setVariableValue(ErrorString*, const String* in_callFrame, const String* in_functionObjectId, int in_scopeNumber, const String& in_variableName, const RefPtr<InspectorObject>& in_newValue);
+    virtual void setVariableValue(ErrorString*, int in_scopeNumber, const String& in_variableName, const RefPtr<InspectorObject>& in_newValue, const String* in_callFrame, const String* in_functionObjectId);
 
     void schedulePauseOnNextStatement(InspectorFrontend::Debugger::Reason::Enum breakReason, PassRefPtr<InspectorObject> data);
     void cancelPauseOnNextStatement();