Bug 216764 - [JSC] Proxy should be trapped if base value is primitive
Summary: [JSC] Proxy should be trapped if base value is primitive
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-09-21 02:25 PDT by Yusuke Suzuki
Modified: 2020-10-19 12:59 PDT (History)
9 users (show)

See Also:


Attachments
Patch (5.50 KB, patch)
2020-09-21 02:30 PDT, Yusuke Suzuki
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yusuke Suzuki 2020-09-21 02:25:24 PDT
[JSC] Proxy should be trapped if base value is primitive
Comment 1 Yusuke Suzuki 2020-09-21 02:30:03 PDT
Created attachment 409264 [details]
Patch
Comment 2 Darin Adler 2020-09-21 09:49:39 PDT
Comment on attachment 409264 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=409264&action=review

> Source/JavaScriptCore/runtime/JSCJSValue.cpp:188
> +                ProxyObject* proxy = jsCast<ProxyObject*>(obj);

auto to avoid repeating the same type name twice?
Comment 3 Yusuke Suzuki 2020-09-21 11:28:14 PDT
Committed r267348: <https://trac.webkit.org/changeset/267348>
Comment 4 Yusuke Suzuki 2020-09-21 11:30:07 PDT
Landed with the proposed change.
Comment 5 Radar WebKit Bug Importer 2020-09-21 12:22:29 PDT
<rdar://problem/69319577>
Comment 6 Alexey Shvayka 2020-10-19 12:59:14 PDT
Comment on attachment 409264 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=409264&action=review

> Source/JavaScriptCore/ChangeLog:9
> +        So, if proxy exists in the prototype chain for the primitive values (e.g. StringPrototype -> Proxy chain),

While this patch nicely handles ProxyObject, other objects that override put() need special care as well.
Please see https://bugs.webkit.org/show_bug.cgi?id=217916.