flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <aha...@adobe.com>
Subject [FalconJX][FlexJS] Local Functions code gen
Date Fri, 19 Apr 2013 21:17:55 GMT
Erik,

It looks like you took the ³var self=this² out.  How are you supposed to
call local functions?  For example, this AS:

Class A
{
    public var foo:String;
    public function bar():String
    {
        return foobar();
        function foobar():String
        {
            return foo;
        }
    }
}

Should the output JS use goog.bind to call foobar?  Is there ever a time
when goog.bind is not used to call a local function?

A.prototype.bar = function()
{
    return goog.bind(foobar, this)();
    function foobar():String
    {
        return this.foo;
    }
}
-- 
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui


Mime
View raw message