You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Harbs <ha...@gmail.com> on 2016/08/07 10:21:55 UTC

FlexJS Language.closure

When you pass a function reference in FlexJS, the compiler adds a call to Language.closure(). Why is that necessary? Why can’t a function just be passed directly?

Harbs

Re: FlexJS Language.closure

Posted by Alex Harui <ah...@adobe.com>.

On 8/7/16, 3:21 AM, "Harbs" <ha...@gmail.com> wrote:

>When you pass a function reference in FlexJS, the compiler adds a call to
>Language.closure(). Why is that necessary? Why can’t a function just be
>passed directly?

The 'this' pointer would be incorrect if the function is a method.

-Alex