Butternut seems to have problems handling labels: in combination with if/elseand other blocks. It generates invalid semicolons after blocks.
This seems to be an unfixed edge case of #113.
Reproduction:
Create an if/else structure with no braces around the if block.
Nest another control structure inside (while, for or switch), with braces around the block and multiple statements inside which are not simply combineable by a comma.
Precede the nested control structure with a label.
Example input:
if ( any_condition_1 )
label: while ( any_condition_2 ) {
var any_value
any_fn_1()
break label
}
else any_fn_2()
From squashing minified [basis.js].
Butternut seems to have problems handling
labels:
in combination withif
/else
and other blocks. It generates invalid semicolons after blocks.This seems to be an unfixed edge case of #113.
Reproduction:
if
/else
structure with no braces around theif
block.while
,for
orswitch
), with braces around the block and multiple statements inside which are not simply combineable by a comma.Example input:
Output Butternut:
Output UglifyJS: