RESOLVED FIXED 76517
Add [CallWith] support for attributes in JS/V8 idl code generators.
https://bugs.webkit.org/show_bug.cgi?id=76517
Summary Add [CallWith] support for attributes in JS/V8 idl code generators.
Pablo Flouret
Reported 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.
Attachments
patch (53.43 KB, patch)
2012-01-17 23:04 PST, Pablo Flouret
no flags
refactored some of the [CallWith] code for functions (56.56 KB, patch)
2012-01-18 11:12 PST, Pablo Flouret
no flags
Pablo Flouret
Comment 1 2012-01-17 23:04:28 PST
Pablo Flouret
Comment 2 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
WebKit Review Bot
Comment 3 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.
Kentaro Hara
Comment 4 2012-01-17 23:10:31 PST
Informal r+
Adam Barth
Comment 5 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.
Pablo Flouret
Comment 6 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.
Pablo Flouret
Comment 7 2012-01-18 11:12:00 PST
Created attachment 122967 [details] refactored some of the [CallWith] code for functions
WebKit Review Bot
Comment 8 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.
Adam Barth
Comment 9 2012-01-18 11:15:11 PST
Comment on attachment 122967 [details] refactored some of the [CallWith] code for functions Thanks!
WebKit Review Bot
Comment 10 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>
WebKit Review Bot
Comment 11 2012-01-18 12:29:50 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.