history.state's implementation in http://webkit.org/b/76035 brought up the need for [CallWith] for attributes.
Created attachment 122877 [details] patch
The patch contains the fixes from the comments on https://bugs.webkit.org/show_bug.cgi?id=76035#c38
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.
Informal r+
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.
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.
Created attachment 122967 [details] refactored some of the [CallWith] code for functions
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 on attachment 122967 [details] refactored some of the [CallWith] code for functions Thanks!
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>
All reviewed patches have been landed. Closing bug.