[webkit-reviews] review denied: [Bug 177398] JSC should throw if proxy set returns falsish in strict mode context : [Attachment 371877] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Jun 11 17:37:00 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 371877: Patch
https://bugs.webkit.org/attachment.cgi?id=371877&action=review
--- Comment #13 from Yusuke Suzuki <ysuzuki at apple.com> ---
Comment on attachment 371877
--> https://bugs.webkit.org/attachment.cgi?id=371877
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=371877&action=review
Looks nice
> JSTests/stress/proxy-set.js:99
> + proxy.x = 40;
Can you add a test for indexed access case? `proxy[42] = 40`. I think it will
not throw an error right now.
> Source/JavaScriptCore/runtime/ProxyObject.cpp:487
> + if (!success && slot.isStrictMode()) {
> + throwVMTypeError(exec, scope, makeString("Proxy object's 'set' trap
returned falsy value for property '", String(propertyName.uid()), "'"));
> + return false;
> + }
Now, I think that we should move this check inside performPut. performPut is
used by putByIndex case too. Currently, we are missing putByIndex case because
we have a check here.
Inside performPut, we have `trapResultAsBool` condition. We should throw an
error if it is done in the strict mode (passing shouldThrow parameter).
More information about the webkit-reviews
mailing list