On Nov 28, 2013, at 12:25 AM, Axel Rauschmayer <[email protected]> wrote:

> Source: David Herman, 
> https://github.com/rwaldron/tc39-notes/blob/master/es6/2013-11/nov-20.md
> 
> Can someone elaborate? I don’t see an alternative.

I can't remember the example I used in the meeting, but one example is a 
recursive function:

  class Chicken extends Weapon {
    constructor(length, elasticity, initialVelocity) {
      this.length = length;
      this.elasticity = elasticity;
      this.initialVelocity = initialVelocity;

      var self = this;

      function animate() {
        ...
        self.velocity
        self.elasticity
        self.length
        ...
        setTimeout(animate, n);
        ...
      }

      ...
    }
  }

The point I was making in the meeting was that arrow functions are a syntactic 
convenience for a common case, not a general-purpose replacement for all 
functions that need to refer to an outer this-binding. They are not 
general-purpose because they don't support all the features of longhand 
functions.

Dave

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to