Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 971 - JS complex inline function is not optimized - haxe #971

Closed
issuesbot opened this issue May 28, 2013 · 1 comment
Closed

Issue 971 - JS complex inline function is not optimized - haxe #971

issuesbot opened this issue May 28, 2013 · 1 comment
Labels
platform-javascript Everything related to JS / JavaScript

Comments

@issuesbot
Copy link

[Google Issue #971 : https://code.google.com/p/haxe/issues/detail?id=971]
by andy@onthewings.net, at 19/06/2012, 18:56:45
Using haxe ca3b272, the following haxe code:

package;
class Test {
    static function main():Void {
        inline function test() {
            var a = [];
            a.push(123);
            return a;
            }
        trace(test());
        }
    }

is compiled to:

var Test = function() { }
   Test.main = function() {
    console.log((function($this) {
        var $r;
        var a = [];
        a.push(123);
        $r = a;
        return $r;
    }(this)));
    }
Test.main();

"$r" is redundant. It can directly return "a" instead.

@issuesbot
Copy link
Author

[comment from ncanna...@gmail.com, published at 19/06/2012, 19:29:03]
We are planning to remove the function($this) {} wrapper in Haxe 3, see issue #247

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform-javascript Everything related to JS / JavaScript
Projects
None yet
Development

No branches or pull requests

1 participant