arrows and a proposed softCall

Brendan Eich brendan at mozilla.com
Tue Jun 5 11:58:41 PDT 2012


Angus Croll wrote:
> Is call/apply just a remedy for non-lexical this assignment? Or is it 
> a powerful feature in it own right.

This isn't a well-defined question. Do you mean "powerful" as in, must 
be able to override |this| via the |thisArg| first parameter?

We know that's not possible even in ES3, did that make call/apply "less 
powerful"? Hard to believe since they were added in ES3.

If not, does *adding* arrows then somehow "reduce" the power of 
call/apply? How?

Anyway, call/apply is not "just a remedy" for non-lexical |this| 
assignment (dynamic |this| binding other than by capturing the callable 
as a method in the receiving object). ES3 added call/apply to support 
invocation given an explict thisArg, and in particular added apply to 
support passing actual args in an array or arguments object instead of 
positionally.

I fear we're not wrapping up if we are talking about "power". This isn't 
post-structural literary analysis, ya know!

/be


More information about the es-discuss mailing list