Methods: automatic binding on read?

Axel Rauschmayer axel at rauschma.de
Thu Apr 12 09:58:24 PDT 2012


I wonder if, with the concise method notation for literals (and possibly class declarations), one couldn’t introduce three modes of accessing a property: Read (getter), write (setter) and call (call interceptor?).

- Manually assigned functions: everything works as it does now.
- Concise method notation:
   - Read: bind `this`
   - Write: apply defineMethod to the argument (not sure about this one)
   - Call: same as before

I have no idea how this would fit into the current semantics, so it might be a silly idea, but it would eliminate a common source of bugs.

-- 
Dr. Axel Rauschmayer
axel at rauschma.de

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120412/a23ca86d/attachment-0001.html>


More information about the es-discuss mailing list