[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 17:37:00 PDT 2019


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

Yusuke Suzuki <ysuzuki at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #371877|review?                     |review-
              Flags|                            |

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

-- 
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/20190612/3021f4e4/attachment-0001.html>


More information about the webkit-unassigned mailing list