HaxeFoundation / HaxeFoundation/haxe
[analyzer] immediately-invoked-by-analyzer anonymous functions are not optimized away
Open
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
Assessment
This issue has not been assessed yet.