[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 08:08:55 PDT 2018


https://bugs.webkit.org/show_bug.cgi?id=190137

Yusuke Suzuki <yusukesuzuki at slowstart.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #351244|review?                     |review+, commit-queue-
              Flags|                            |

--- 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)));

-- 
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/d06a6ec5/attachment.html>


More information about the webkit-unassigned mailing list