HaxeFoundation / HaxeFoundation/haxe

[analyzer] immediately-invoked-by-analyzer anonymous functions are not optimized away

Open
#9,228 6 comments 0 reactions 0 assignees View on GitHub
enhancement feature-analyzer
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

```haxe
class Main {
static function main() {
var f = a -> a;
trace(f(3));

trace((a -> a)(3));
}
}
```

```js
console.log("src/Main.hx:4:",(function(a) {
return a;
})(3));
console.log("src/Main.hx:6:",3);
```

This is because IIFE optimization is done before the analyzer optimization, but maybe it should be done both before and after it.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.