[webkit-reviews] review granted: [Bug 190137] [JSC] Add a C++ callable overload of objectConstructorSeal : [Attachment 351244] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Oct 1 08:08:55 PDT 2018
Yusuke Suzuki <yusukesuzuki at slowstart.org> has granted Koby
<koby.b at mce.systems>'s request for review:
Bug 190137: [JSC] Add a C++ callable overload of objectConstructorSeal
https://bugs.webkit.org/show_bug.cgi?id=190137
Attachment 351244: Patch
https://bugs.webkit.org/attachment.cgi?id=351244&action=review
--- Comment #2 from Yusuke Suzuki <yusukesuzuki at slowstart.org> ---
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:795
> if (UNLIKELY(!success)) {
> - throwTypeError(exec, scope, "Unable to prevent extension in
Object.seal"_s);
> - return encodedJSValue();
> + return throwTypeError(exec, scope, "Unable to prevent extension in
Object.seal"_s);
> }
Remove `{` and `}`.
> Source/JavaScriptCore/runtime/ObjectConstructor.cpp:803
> + VM& vm = exec->vm();
> + 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.
> Source/JavaScriptCore/runtime/ObjectConstructor.cpp:811
> + JSObject* result = objectConstructorSeal(exec, asObject(obj));
> + RETURN_IF_EXCEPTION(scope, encodedJSValue());
> + return JSValue::encode(result);
In this case, we can just do
return JSValue::enccode(objectConstructorSeal(exec, asObject(obj)));
More information about the webkit-reviews
mailing list