Proposal: Abstract References
domenic at domenicdenicola.com
Tue Oct 21 13:12:16 PDT 2014
This is really cool, Kevin. Thanks for writing it up in more detail. I hope it gets a lot of attention.
My initial worries are largely around the ergonomics---both for authors and implementers---if this is our solution for private state. In particular, I don't think having to create a new WeakMap for every private "member" is very author-friendly. And in general, implementers have voiced (weak) objections to using weak maps for private state in saying that they're not designed to work efficiently in that manner. (And that was with the pattern of one WeakMap per class, not multiple!)
That said, this is really elegant and if nothing else it seems like good underpinnings for some slightly-higher-level private state abstraction. And of course you know I <3 the "bind operator".
Hope to hear other TC39ers' thoughts!
More information about the es-discuss