Bug 124729

Summary: Only generate isObservable() when IDL specifies GenerateIsReachable
Product: WebKit Reporter: Daniel Bates <dbates>
Component: BindingsAssignee: Daniel Bates <dbates>
Status: RESOLVED FIXED    
Severity: Normal CC: alecflett, cdumez, commit-queue, eric.carlson, esprehn+autocc, glenn, jer.noble, jsbell, kondapallykalyan
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch and test ggaren: review+

Description Daniel Bates 2013-11-21 11:32:44 PST
We should only generate the static inline function isObservable when an IDL specifies GenerateIsReachable. Otherwise, this function is unused.
Comment 1 Daniel Bates 2013-11-21 11:35:36 PST
Created attachment 217589 [details]
Patch and test
Comment 2 Daniel Bates 2013-11-21 11:39:03 PST
Note, I also added a space character to the right hand side of the first disjunct operator in the following line in CodeGeneratorJS.pm:

if ((!$hasParent && !GetCustomIsReachable($interface))|| GetGenerateIsReachable($interface) || $codeGenerator->InheritsExtendedAttribute($interface, "ActiveDOMObject")) {
        if (GetGenerateIsReachable($interface)) {

So that it would read:

if ((!$hasParent && !GetCustomIsReachable($interface)) || GetGenerateIsReachable($interface) || $codeGenerator->InheritsExtendedAttribute($interface, "ActiveDOMObject")) {
        if (GetGenerateIsReachable($interface)) {
Comment 3 WebKit Commit Bot 2013-11-21 11:39:16 PST
Attachment 217589 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCore/bindings/scripts/CodeGeneratorJS.pm', u'Source/WebCore/bindings/scripts/test/CPP/WebDOMTestGenerateIsReachable.cpp', u'Source/WebCore/bindings/scripts/test/CPP/WebDOMTestGenerateIsReachable.h', u'Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestGenerateIsReachable.cpp', u'Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestGenerateIsReachable.h', u'Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestGenerateIsReachablePrivate.h', u'Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp', u'Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp', u'Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp', u'Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp', u'Source/WebCore/bindings/scripts/test/JS/JSTestException.cpp', u'Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp', u'Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.h', u'Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp', u'Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp', u'Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp', u'Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp', u'Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp', u'Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp', u'Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp', u'Source/WebCore/bindings/scripts/test/JS/JSattribute.cpp', u'Source/WebCore/bindings/scripts/test/JS/JSreadonly.cpp', u'Source/WebCore/bindings/scripts/test/ObjC/DOMTestGenerateIsReachable.h', u'Source/WebCore/bindings/scripts/test/ObjC/DOMTestGenerateIsReachable.mm', u'Source/WebCore/bindings/scripts/test/ObjC/DOMTestGenerateIsReachableInternal.h', u'Source/WebCore/bindings/scripts/test/TestGenerateIsReachable.idl']" exit_code: 1
Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:158:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 1 in 13 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Daniel Bates 2013-11-21 11:40:26 PST
(In reply to comment #2)
> Note, I also added a space character to the right hand side of the first disjunct operator in the following line in CodeGeneratorJS.pm:

*left hand side of the first disjunct
Comment 5 Geoffrey Garen 2013-11-21 12:13:54 PST
Comment on attachment 217589 [details]
Patch and test

r=me
Comment 6 Daniel Bates 2013-11-21 15:17:09 PST
Committed r159648: <http://trac.webkit.org/changeset/159648>