[Webkit-unassigned] [Bug 177398] JSC should throw if proxy set returns falsish in strict mode context
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Jun 11 12:18:31 PDT 2019
https://bugs.webkit.org/show_bug.cgi?id=177398
Yusuke Suzuki <ysuzuki at apple.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #371843|review? |review-
Flags| |
--- 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`.
--
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/20190611/3a2dc122/attachment-0001.html>
More information about the webkit-unassigned
mailing list