Missed IIFE inlining opportunity
Given this code:
(function() {
var $fun;
var $str;
(function() {
$fun = function(a) {
return console.log(a);
};
$str = "hello";
})();
(function() {
$fun($str);
})();
})();
It could be inlined all the way to:
console.log("hello");
However, Closure Compiler today only reduces that to:
(function() {
var a, b;
(function() {
a = function(a) {
return console.log(a);
};
b = "hello";
})();
a(b);
})();
Fixed by https://github.com/google/closure-compiler/commit/ef9ff6433890d76eb9bc66148cc02c7dd0f96517.
This doesn't seem to be fixed yet, at least on the online playground, or in the latest maven package (v20160713).
That is, the specific example I gave still doesn't get inlined all the way down. Any ideas why?
The change was rolled back at commit 0660acdb4691cade499563c663a2c83243d0c4b2.
This is a missed optimisation I'm noticing most often in our projects as well.