Bug 109488 - Web Inspector: fix closure compilation warnings caused by setVariableValue change
Summary: Web Inspector: fix closure compilation warnings caused by setVariableValue ch...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-11 14:20 PST by Peter Rybin
Modified: 2013-02-14 09:53 PST (History)
12 users (show)

See Also:


Attachments
Patch (7.29 KB, patch)
2013-02-11 14:35 PST, Peter Rybin
no flags Details | Formatted Diff | Diff
Patch (8.07 KB, patch)
2013-02-12 09:32 PST, Peter Rybin
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Rybin 2013-02-11 14:20:35 PST
As reported by vsevik@ (thank you), the change causes several warnings.

Source/WebCore/inspector/InjectedScriptSourceTmp.js:600: WARNING - Bad type annotation. Unknown type integer
     * @param {integer} scopeNumber
               ^
Source/WebCore/inspector/InjectedScriptSourceTmp.js:618: WARNING - Property setFunctionVariableValue never defined on InjectedScriptHost
            setter = InjectedScriptHost.setFunctionVariableValue.bind(InjectedScriptHost, func); 
                     ^
Source/WebCore/inspector/front-end/protocol-externs.js:2085: WARNING - optional arguments must be at the end
DebuggerAgent.setVariableValue = function(opt_callFrameId, opt_functionObjectId, scopeNumber, variableName, newValue, opt_callback) {}
Comment 1 Peter Rybin 2013-02-11 14:35:41 PST
Created attachment 187676 [details]
Patch
Comment 2 Peter Rybin 2013-02-11 14:37:57 PST
(In reply to comment #1)
> Created an attachment (id=187676) [details]
> Patch

vsevik@, could you please take a look at the patch.

Note that in order to satisfy requirement that optional parameters go last, I tried to reorder parameters in Inspector.json, those ones that originally were first, but recently became optional.
I'm not sure though, that we can afford reordering parameters.
Comment 3 Yury Semikhatsky 2013-02-12 01:29:33 PST
Comment on attachment 187676 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=187676&action=review

> Source/WebCore/inspector/Inspector.json:2936
> +                    { "name": "newValue", "$ref": "Runtime.CallArgument", "description": "New variable value." },

Can you provide a test for this command?
Comment 4 Yury Semikhatsky 2013-02-12 01:32:23 PST
Comment on attachment 187676 [details]
Patch

The patch introduces new warnings:

Compiling InjectedScriptSource.js...
Source/WebCore/inspector/InjectedScriptSourceTmp.js:609: WARNING - actual parameter 2 of InjectedScript.prototype._callFrameForId does not match formal parameter
found   : (boolean|string)
required: string
            var callFrame = this._callFrameForId(topCallFrame, callFrameId);
                                                               ^

Source/WebCore/inspector/InjectedScriptSourceTmp.js:614: WARNING - actual parameter 1 of InjectedScript.prototype._parseObjectId does not match formal parameter
found   : (boolean|string)
required: string
            var parsedFunctionId = this._parseObjectId(functionObjectId);
                                                       ^

0 error(s), 2 warning(s), 89.8% typed
Comment 5 Peter Rybin 2013-02-12 01:41:52 PST
Comment on attachment 187676 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=187676&action=review

>> Source/WebCore/inspector/Inspector.json:2936
>> +                    { "name": "newValue", "$ref": "Runtime.CallArgument", "description": "New variable value." },
> 
> Can you provide a test for this command?

I thought LayoutTests/inspector-protocol/debugger-setVariableValue.html was that test.
Comment 6 Yury Semikhatsky 2013-02-12 03:15:55 PST
(In reply to comment #5)
> (From update of attachment 187676 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=187676&action=review
> 
> >> Source/WebCore/inspector/Inspector.json:2936
> >> +                    { "name": "newValue", "$ref": "Runtime.CallArgument", "description": "New variable value." },
> > 
> > Can you provide a test for this command?
> 
> I thought LayoutTests/inspector-protocol/debugger-setVariableValue.html was that test.

Oh, I see. I meant that it would be nice if we had a test that would require changes in accord with your concern https://bugs.webkit.org/show_bug.cgi?id=109488#c2
Comment 7 Peter Rybin 2013-02-12 03:47:43 PST
(In reply to comment #6)
> (In reply to comment #5)
> > (From update of attachment 187676 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=187676&action=review
> > 
> > >> Source/WebCore/inspector/Inspector.json:2936
> > >> +                    { "name": "newValue", "$ref": "Runtime.CallArgument", "description": "New variable value." },
> > > 
> > > Can you provide a test for this command?
> > 
> > I thought LayoutTests/inspector-protocol/debugger-setVariableValue.html was that test.
> 
> Oh, I see. I meant that it would be nice if we had a test that would require changes in accord with your concern https://bugs.webkit.org/show_bug.cgi?id=109488#c2

That's right. But so far we don't any client that depends on parameter order. I don't think we should prepare such client only to prove that parameter order in fact changed.

However, I wonder if we should change parameter order. For example Java project bindings depends on order and theoretically such changes might go unnoticed unless caught by parameter type checks.
Comment 8 Peter Rybin 2013-02-12 09:32:14 PST
Created attachment 187882 [details]
Patch
Comment 9 WebKit Review Bot 2013-02-14 09:53:44 PST
Comment on attachment 187882 [details]
Patch

Clearing flags on attachment: 187882

Committed r142888: <http://trac.webkit.org/changeset/142888>
Comment 10 WebKit Review Bot 2013-02-14 09:53:49 PST
All reviewed patches have been landed.  Closing bug.