Remove function declaration inside conditional.

Strictly speaking, this is not legal ECMA-262 syntax, since a function
declaration is not a statement and thus shouldn’t appear as part of a
block.  The reason for this is inconsistent hoisting behaviour across
implementations.  For example, V8 will always hoist a function
declaration, even if it’s inside a conditional block, but Firefox will
not hoist function declarations inside conditional blocks.

Fixes #2114, #1553.