WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED DUPLICATE of
bug 164849
Bug 171915
[JSC] Proxy's GetPrototypeOf does not invoked during access to __proto__ property
https://bugs.webkit.org/show_bug.cgi?id=171915
Summary
[JSC] Proxy's GetPrototypeOf does not invoked during access to __proto__ prop...
GSkachkov
Reported
2017-05-10 01:48:37 PDT
Also I found interesting behavior of proxy: ``` var target = {}; proxy = new Proxy(target, { getPrototypeOf(t) { console.log("get prototype:", t); return t.__proto__; } }); proxy.__proto__ === target.__proto__; ``` In Chrome & FireFox it prints: // get prototype: .... // Object ... In jsc we do not print `get prototype: ....`, just `Object ...`
Attachments
Add attachment
proposed patch, testcase, etc.
Saam Barati
Comment 1
2017-05-10 09:39:42 PDT
Maybe we don't properly forward the receiver? I think this code should definitely go down the get() path in Proxy, but maybe the issue is we don't call get() on target in the correct way.
GSkachkov
Comment 2
2017-05-10 09:46:26 PDT
(In reply to Saam Barati from
comment #1
)
> Maybe we don't properly forward the receiver? > I think this code should definitely go down the get() path in Proxy, but > maybe the issue is we don't call get() on target in the correct way.
Hmm, It seems that you right. If I add get, it start invoke getPrototypeOf ``` var target = {}; var proxy = new Proxy(target, { getPrototypeOf(t, ) { print("get prototype:", t); return t; }, get(t, property, receiver) { print("get", property); return Reflect.get(t, property, receiver); } }); ``` Output:
>>> proxy.__proto__
get __proto__ get prototype: [object Object] [object Object]
GSkachkov
Comment 3
2017-05-10 13:25:59 PDT
(In reply to Saam Barati from
comment #1
)
> Maybe we don't properly forward the receiver? > I think this code should definitely go down the get() path in Proxy, but > maybe the issue is we don't call get() on target in the correct way.
In casa if we use only getPrototypeOf handler, we just call target->get() for __proto__ property in performProxyGet, so we forget that we are executing in proxy context, that why we do not call proxy getPrototypeOf handler, but according to spec we should invoke target.[[Get]](P, Receiver) - where Receiver is current Proxy. So I think we need create new method for JSObject that support Receiver as the parameter
GSkachkov
Comment 4
2017-05-30 12:18:10 PDT
Fixed by
bug 164849
*** This bug has been marked as a duplicate of
bug 164849
***
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug