-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
Description
Closure compiler v20200614
in.js:
{
function foo(p) { self["external1"](p) }
console.log(foo());
console.log(foo());
}
Command: java -jar ./closure-compiler.jar --js in.js --js_output_file out.js --compilation_level WHITESPACE_ONLY --formatting PRETTY_PRINT
out.js:
{
var foo = function(p) {
self["external1"](p);
};
console.log(foo());
console.log(foo());
}
;
Note that function foo(p)
was rewritten as var foo = function(p)
. This is not a whitespace-only change. It also causes a bug (#3623). Therefore even using the lowest tier of WHITESPACE_ONLY optimizations, we cannot escape this bug. I think it is reasonable to expect WHITESPACE_ONLY to only do what it says and not make other adjustments which alter the way scripts work.
ctjlewis, customcommander and sabberworm