Instance bound class methods

Bergi a.d.bergi at web.de
Sun Jul 19 19:36:15 UTC 2015


Matthew Robb schrieb:
> What I'd really like to have in the language is the ability to store a
> property access into a single binding

Notice that the https://github.com/zenparsing/es-function-bind proposal 
does exactly this, at least for methods (and I don't think I would want 
it for arbitrary assignments). Your example code would look like this:

     let someObj = { doStuff(){} };

     let doStuff = ::someObj.doStuff;

     doStuff();

  Bergi




More information about the es-discuss mailing list