src/generators/dom/visitors/IfBlock.js/visitIfBlock
export default function visitIfBlock ( generator, block, state, node ) {
	const name = generator.getUniqueName( `if_block` );
	const anchor = generator.getUniqueName( `${name}_anchor` );
	const params = block.params.join( ', ' );

	const vars = { name, anchor, params };

	block.createAnchor( anchor, state.parentNode );

	const branches = getBranches( generator, block, state, node, generator.getUniqueName( `create_if_block` ) );
	const dynamic = branches.some( branch => branch.dynamic );

	if ( node.else ) {
		compound( generator, block, state, node, branches, dynamic, vars );
	} else {
		simple( generator, block, state, node, branches[0], dynamic, vars );
	}

	block.builders.destroy.addLine(
		`if ( ${name} ) ${name}.destroy( ${state.parentNode ? 'false' : 'detach'} );`
	);
}