> Having done this dance a couple of times, let me suggest to you that the
> method form will *eventually* end up at a per-class getter on the prototype
> which vends an instance function which is bound. People will (reasonably)
> want binding of some sort.
This sounds lovely. I vaguely remember seeing it on es-discuss in the past (for
one of the built-ins or proposed built-ins, maybe?). But never in the wild.
I'm curious, though---what advantages does this have over simply setting the
method as an instance property? I.e. how does it differ from the following
pattern?
function C() {
var that = this;
that.method = function () {
console.log(that);
};
}
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss