Methods: automatic binding on read?

Brendan Eich brendan at
Fri Apr 13 14:40:29 PDT 2012

You mean "automatic binding with memoization on read", I hope.

Otherwise you break o.m === o.m.

This can be implemented with accessors and weakmaps, of course. That 
says two things to me:

1. It ain't cheap so should not be default, esp. not for method 
definition shorthand.

2. We should let the cows make a pavement-worthy path.


Axel Rauschmayer wrote:
> 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 <mailto:axel at>
> home: <>
> twitter: <>
> blog: <>
> _______________________________________________
> es-discuss mailing list
> es-discuss at

More information about the es-discuss mailing list