Closed
Bug 643100
Opened 14 years ago
Closed 12 years ago
add receiver object to all proxy traps that need it, and pass the proxy itself as final (optional) argument
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: gal, Assigned: gal)
References
Details
Attachments
(1 file)
39.69 KB,
patch
|
Details | Diff | Splinter Review |
There is currently no way to reach the receiver object, which severely limits the ability of proxies to be used on the proto chain of objects. If traps need the handler they can close over it, whereas there is no alternative way to get to the receiver object.
This blocks self-hosted WebIDL bindings.
Comment 1•14 years ago
|
||
We have been discussing this issue on es-discuss. It has led to the following strawman: http://wiki.ecmascript.org/doku.php?id=strawman:handler_access_to_proxy
(adding an argument which value is the proxy to all traps).
The 'this' binding to the handler is used in derived traps in order to implement default trap behavior.
Are you suggesting the binding should occur only during trap calls or that the proxy replaces the handler functions by bound functions at init time or anything like that?
Assignee | ||
Updated•14 years ago
|
Summary: in proxy traps, bind 'this' to the receiver object, not the handler → add receiver object to all proxy traps that need it, and pass the proxy itself as final (optional) argument
Assignee | ||
Comment 2•14 years ago
|
||
Assignee: general → gal
Assignee | ||
Updated•14 years ago
|
Attachment #522903 -
Flags: review?(jorendorff)
Comment 3•14 years ago
|
||
Comment on attachment 522903 [details] [diff] [review]
patch
Clearing ancient review flag. Last I heard about this was a quick "don't review that yet" in passing from gal, in Santa Cruz, months ago.
Attachment #522903 -
Flags: review?(jorendorff)
Comment 4•14 years ago
|
||
An interesting point has been made on es-discuss leading to http://wiki.ecmascript.org/doku.php?id=strawman:proxy_drop_receiver
In conjunction with http://wiki.ecmascript.org/doku.php?id=strawman:handler_access_to_proxy
it would mean that:
- All traps get an optional final "proxy" argument which value is the proxy the trap is being called on.
- No receiver argument anywhere anymore.
A decision may be made at the TC39 July meeting.
Updated•14 years ago
|
Blocks: harmony:proxies
Updated•13 years ago
|
Blocks: harmony:proxy
Updated•13 years ago
|
No longer blocks: harmony:proxy
Comment 5•12 years ago
|
||
Marking this bug as invalid since it is not relevant with the direct proxies design.
Feel free to change the status if I'm mistaken.
Updated•12 years ago
|
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•