[webkit-reviews] review denied: [Bug 177398] JSC should throw if proxy set returns falsish in strict mode context : [Attachment 371843] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Jun 11 12:18:31 PDT 2019
Yusuke Suzuki <ysuzuki at apple.com> has denied Alexey Shvayka
<shvaikalesh at gmail.com>'s request for review:
Bug 177398: JSC should throw if proxy set returns falsish in strict mode
context
https://bugs.webkit.org/show_bug.cgi?id=177398
Attachment 371843: Patch
https://bugs.webkit.org/attachment.cgi?id=371843&action=review
--- Comment #7 from Yusuke Suzuki <ysuzuki at apple.com> ---
Comment on attachment 371843
--> https://bugs.webkit.org/attachment.cgi?id=371843
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=371843&action=review
Nice catch. Can you add a test for this?
> Source/JavaScriptCore/runtime/ProxyObject.cpp:483
> + RETURN_IF_EXCEPTION(scope, encodedJSValue());
Use `false` instead of `encodedJSValue()`.
> Source/JavaScriptCore/runtime/ProxyObject.cpp:485
> + throwVMTypeError(exec, scope, makeString("Proxy object's 'set' trap
returned falsy value for property '", String(propertyName.uid()), "'"));
When throwing an error, we should also `return` here.
if (!success && slot.isStrictMode()) {
throwVMTypeError(exec, scope, makeString("Proxy object's 'set' trap
returned falsy value for property '", String(propertyName.uid()), "'"));
return false;
}
> Source/JavaScriptCore/runtime/ProxyObject.cpp:486
> + RELEASE_AND_RETURN(scope, success);
Just returning success is OK because `success` part won't throw an error. So,
`return success`.
More information about the webkit-reviews
mailing list