[webkit-reviews] review granted: [Bug 222434] Add some exception checks to the bindings generator : [Attachment 421560] patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Feb 25 14:03:07 PST 2021
Yusuke Suzuki <ysuzuki at apple.com> has granted Saam Barati <sbarati at apple.com>'s
request for review:
Bug 222434: Add some exception checks to the bindings generator
https://bugs.webkit.org/show_bug.cgi?id=222434
Attachment 421560: patch
https://bugs.webkit.org/attachment.cgi?id=421560&action=review
--- Comment #3 from Yusuke Suzuki <ysuzuki at apple.com> ---
Comment on attachment 421560
--> https://bugs.webkit.org/attachment.cgi?id=421560
patch
View in context: https://bugs.webkit.org/attachment.cgi?id=421560&action=review
r=me, looks good!
> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:1261
> push(@$outputArray, " if (pluginElementCustomPut(thisObject,
lexicalGlobalObject, propertyName, value, putPropertySlot, putResult))\n");
> push(@$outputArray, " return putResult;\n\n");
> + push(@$outputArray, " RETURN_IF_EXCEPTION(throwScope,
false);\n");
I wonder if we need to put `RETURN_IF_EXCEPTION(throwScope, false)` even in
`true` case of pluginElementCustomPut.
bool success = pluginElementCustomPut(...);
RETURN_IF_EXCEPTION(throwScope, false);
if (success)
return putResult;
> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:1266
> push(@$outputArray, " return JSObject::put(thisObject,
lexicalGlobalObject, propertyName, value, putPropertySlot);\n");
How about using this instead?
RELEASE_AND_RETURN(throwScope, JSObject::put(thisObject, lexicalGlobalObject,
propertyName, value, putPropertySlot));
> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:1342
> push(@$outputArray, " if (pluginElementCustomPut(thisObject,
lexicalGlobalObject, propertyName, value, putPropertySlot, putResult))\n");
> push(@$outputArray, " return putResult;\n\n");
> + push(@$outputArray, " RETURN_IF_EXCEPTION(throwScope,
false);\n");
Ditto.
> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:1348
> push(@$outputArray, " return JSObject::putByIndex(cell,
lexicalGlobalObject, index, value, shouldThrow);\n");
Ditto about RELEASE_AND_RETURN.
> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:1506
> push(@$outputArray, " return JSObject::defineOwnProperty(object,
lexicalGlobalObject, propertyName, newPropertyDescriptor, shouldThrow);\n");
Ditto about RELEASE_AND_RETURN.
More information about the webkit-reviews
mailing list