[webkit-reviews] review granted: [Bug 43130] Add callback arguments support to binding code generator scripts : [Attachment 63004] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jul 29 16:18:34 PDT 2010


Dumitru Daniliuc <dumi at chromium.org> has granted Kinuko Yasuda
<kinuko at chromium.org>'s request for review:
Bug 43130: Add callback arguments support to binding code generator scripts
https://bugs.webkit.org/show_bug.cgi?id=43130

Attachment 63004: Patch
https://bugs.webkit.org/attachment.cgi?id=63004&action=review

------- Additional Comments from Dumitru Daniliuc <dumi at chromium.org>
r=me, but please address the comments below before landing (sorry i forgot to
mention them in the first review).

WebCore/bindings/scripts/CodeGeneratorJS.pm:1939
 +				push(@implContent, "	if
(exec->argumentCount() > $argsIndex && !exec->argument($argsIndex).isNull())
{\n");
this code works only if the parameter is Optional. i think it should look more
like this:

push(@implContent, "	RefPtr<" . $parameter->type . "> $name;\n");
if ($parameter->extendedAttributes->{"Optional"}) {
    // push the code that you have now
} else {
    push(@implContent, "    if ((exec->argumentCount() <= $argsIndex) ||
!exec->argument($argsIndex).isObject()) {\n");
    push(@implContent, "	setDOMException(exec, TYPE_MISMATCH_ERR);\n");
    push(@implContent, "	return jsUndefined();\n");
    push(@implContent, "    }\n");
    push(@implContent, "    $name = " . $callbackClassName .
"::create(asObject(exec->argument($argsIndex)),
castedThis->globalObject());\n");
}

WebCore/bindings/scripts/CodeGeneratorV8.pm:1191
 +		push(@implContentDecls, "    if (args.Length() > $paramIndex &&
!isUndefinedOrNull(args[$paramIndex])) {\n");
same thing.


More information about the webkit-reviews mailing list