WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
222434
Add some exception checks to the bindings generator
https://bugs.webkit.org/show_bug.cgi?id=222434
Summary
Add some exception checks to the bindings generator
Saam Barati
Reported
2021-02-25 13:01:05 PST
...
Attachments
patch
(81.63 KB, patch)
2021-02-25 13:55 PST
,
Saam Barati
ysuzuki
: review+
Details
Formatted Diff
Diff
patch for landing
(88.23 KB, patch)
2021-02-25 14:40 PST
,
Saam Barati
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Saam Barati
Comment 1
2021-02-25 13:37:27 PST
<
rdar://69066130
>
Saam Barati
Comment 2
2021-02-25 13:55:35 PST
Created
attachment 421560
[details]
patch
Yusuke Suzuki
Comment 3
2021-02-25 14:03:07 PST
Comment on
attachment 421560
[details]
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.
Saam Barati
Comment 4
2021-02-25 14:27:43 PST
Comment on
attachment 421560
[details]
patch View in context:
https://bugs.webkit.org/attachment.cgi?id=421560&action=review
>> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:1261 >> + 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;
yeah, I think this is the right way to do it. I'll fix.
>> 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));
yeah, I can do that.
Saam Barati
Comment 5
2021-02-25 14:40:30 PST
Created
attachment 421567
[details]
patch for landing
EWS
Comment 6
2021-02-25 17:57:27 PST
Committed
r273524
: <
https://commits.webkit.org/r273524
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 421567
[details]
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug