Bug 76517 - Add [CallWith] support for attributes in JS/V8 idl code generators.
Summary: Add [CallWith] support for attributes in JS/V8 idl code generators.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 76035
  Show dependency treegraph
 
Reported: 2012-01-17 22:57 PST by Pablo Flouret
Modified: 2012-01-18 12:29 PST (History)
7 users (show)

See Also:


Attachments
patch (53.43 KB, patch)
2012-01-17 23:04 PST, Pablo Flouret
no flags Details | Formatted Diff | Diff
refactored some of the [CallWith] code for functions (56.56 KB, patch)
2012-01-18 11:12 PST, Pablo Flouret
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pablo Flouret 2012-01-17 22:57:34 PST
history.state's implementation in http://webkit.org/b/76035 brought up the need for [CallWith] for attributes.
Comment 1 Pablo Flouret 2012-01-17 23:04:28 PST
Created attachment 122877 [details]
patch
Comment 2 Pablo Flouret 2012-01-17 23:06:27 PST
The patch contains the fixes from the comments on https://bugs.webkit.org/show_bug.cgi?id=76035#c38
Comment 3 WebKit Review Bot 2012-01-17 23:07:10 PST
Attachment 122877 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1

Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:1110:  Local variables should never be PassRefPtr (see http://webkit.org/coding/RefPtr.html).  [readability/pass_ptr] [5]
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:1123:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:1137:  Local variables should never be PassRefPtr (see http://webkit.org/coding/RefPtr.html).  [readability/pass_ptr] [5]
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:1154:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:1173:  Local variables should never be PassRefPtr (see http://webkit.org/coding/RefPtr.html).  [readability/pass_ptr] [5]
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:1190:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
Total errors found: 6 in 13 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Kentaro Hara 2012-01-17 23:10:31 PST
Informal r+
Comment 5 Adam Barth 2012-01-17 23:53:59 PST
Comment on attachment 122877 [details]
patch

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

> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:2403
> +        push(@$outputArray, "    ScriptExecutionContext* scriptContext = static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();\n");
> +        push(@$outputArray, "    if (!scriptContext)\n");
> +        push(@$outputArray, "        return" . ($returnVoid ? "" : " jsUndefined()") . ";\n");

Is this code duplicated from somewhere else in this file?  I was expecting to see some minus lines replaced with a call to this function in the location that currently handles CallWith for methods.
Comment 6 Pablo Flouret 2012-01-18 10:18:05 PST
Yeah, you're right, in all the back and forth i forgot to see what could be refactored, i think a couple of calls can be reworked. I'll update the patch.
Comment 7 Pablo Flouret 2012-01-18 11:12:00 PST
Created attachment 122967 [details]
refactored some of the [CallWith] code for functions
Comment 8 WebKit Review Bot 2012-01-18 11:13:09 PST
Attachment 122967 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1

Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:1110:  Local variables should never be PassRefPtr (see http://webkit.org/coding/RefPtr.html).  [readability/pass_ptr] [5]
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:1123:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:1137:  Local variables should never be PassRefPtr (see http://webkit.org/coding/RefPtr.html).  [readability/pass_ptr] [5]
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:1154:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:1173:  Local variables should never be PassRefPtr (see http://webkit.org/coding/RefPtr.html).  [readability/pass_ptr] [5]
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:1190:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
Total errors found: 6 in 13 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 9 Adam Barth 2012-01-18 11:15:11 PST
Comment on attachment 122967 [details]
refactored some of the [CallWith] code for functions

Thanks!
Comment 10 WebKit Review Bot 2012-01-18 12:29:45 PST
Comment on attachment 122967 [details]
refactored some of the [CallWith] code for functions

Clearing flags on attachment: 122967

Committed r105308: <http://trac.webkit.org/changeset/105308>
Comment 11 WebKit Review Bot 2012-01-18 12:29:50 PST
All reviewed patches have been landed.  Closing bug.