[Webkit-unassigned] [Bug 164849] New: Proxy's [[Get]] passes incorrect receiver
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Nov 16 17:55:30 PST 2016
https://bugs.webkit.org/show_bug.cgi?id=164849
Bug ID: 164849
Summary: Proxy's [[Get]] passes incorrect receiver
Classification: Unclassified
Product: WebKit
Version: WebKit Nightly Build
Hardware: Macintosh
OS: OS X 10.11
Status: NEW
Severity: Normal
Priority: P2
Component: JavaScriptCore
Assignee: webkit-unassigned at lists.webkit.org
Reporter: shvaikalesh at gmail.com
Please consider the following code:
```
var target =
{
get prop()
{
console.log(this == proxy) // => `false`, should be `true`
}
}
var proxy = new Proxy(target, {})
proxy.prop
```
`proxy.prop` calls `[[Get]]` on `proxy` with `"prop"` as key and `proxy` as receiver.
Proxy's `[[Get]]` method checks for `get` trap, it is missing, so it should call `[[Get]]` on `target` with **the same** parameters.
However, JSC does not pass receiver, thus `prop` getter is called with context of `target`, not `proxy`.
Both V8 and SpiderMonkey implement this correctly.
tc39/test-262 PR: https://github.com/tc39/test262/pull/792
chai/chaijs issue: https://github.com/chaijs/chai/issues/855
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20161117/3e4ca6d5/attachment.html>
More information about the webkit-unassigned
mailing list