[Webkit-unassigned] [Bug 190137] [JSC] Add a C++ callable overload of objectConstructorSeal
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Oct 1 12:35:05 PDT 2018
https://bugs.webkit.org/show_bug.cgi?id=190137
--- Comment #4 from Keith Miller <keith_miller at apple.com> ---
Comment on attachment 351244
--> https://bugs.webkit.org/attachment.cgi?id=351244
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=351244&action=review
>> Source/JavaScriptCore/runtime/ObjectConstructor.cpp:803
>> + auto scope = DECLARE_THROW_SCOPE(vm);
>
> In this case (expression which can cause an error is the last expression, and we do not have the other expressions which can cause an error), we don't need it.
I'm personally of the belief that we should have the scope anyway as the code can change in the future. It's good to be safe.
>> Source/JavaScriptCore/runtime/ObjectConstructor.cpp:811
>> + return JSValue::encode(result);
>
> In this case, we can just do
>
> return JSValue::enccode(objectConstructorSeal(exec, asObject(obj)));
If you decide to keep the scope, I would do:
scope.release();
return JSValue::enccode(objectConstructorSeal(exec, asObject(obj)));
Maybe we should have a macro for releasing then returning? We seem to do it a lot.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20181001/59f919e5/attachment.html>
More information about the webkit-unassigned
mailing list