In GObject DOM API there is a webkit_dom_range_compare_boundary_points function ( https://developer.mozilla.org/en-US/docs/Web/API/Range.compareBoundaryPoints ) that takes second argument "how" that's type is CompareHow (in GObject DOM API it is defined as gushort). CompareHow is enum defined in http://trac.webkit.org/browser/trunk/Source/WebCore/dom/Range.h#L87 . The problem is that START_TO_START is defined first so it has value 0, but the generator is not counting with it and it generates g_return_val_if_fail (how, 0) in WebKitDOMRange.cpp. Thus we will get a nice runtime warning: CRITICAL **: gshort webkit_dom_range_compare_boundary_points(WebKitDOMRange*, gushort, WebKitDOMRange*, GError**): assertion 'how' failed . So the generator should be aware of CompareHow while generating the g_return_* macros.
Created attachment 224845 [details] Proposed patch
Comment on attachment 224845 [details] Proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=224845&action=review Thanks for the patch. I think we should add a test case for this. > Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm:897 > + if ($paramIDLType eq "CompareHow") { > + return ""; > + } This is not correct, this method should not be called for non pointer types. We are currently checking whether the param type is primitve or not, but we should actually check that is a pointer type. my $paramTypeIsPrimitive = $codeGenerator->IsPrimitiveType($paramIDLType); my $paramIsGDOMType = IsGDOMClassType($paramIDLType); if (!$paramTypeIsPrimitive) { $gReturnMacro = GetGReturnMacro($paramName, $paramIDLType, $returnType, $functionName); push(@cBody, $gReturnMacro); } We should use my $paramTypeIsPointer = !$codeGenerator->IsNonPointerType($paramIDLType); You can also remove the paramIsGDOMType that is unused :-)
Created attachment 225638 [details] Proposed patch v2
Comment on attachment 225638 [details] Proposed patch v2 Thanks!
Comment on attachment 225638 [details] Proposed patch v2 Clearing flags on attachment: 225638 Committed r164980: <http://trac.webkit.org/changeset/164980>
All reviewed patches have been landed. Closing bug.