A function declaration standing alone as an if branch outside strict
mode code is in a block of its own (Annex B.3.4), so a function of the
same name in the block around the if keeps it from assigning the outer
variable: var f; { function f() { return 1; } if (true) function f()
{ return 2; } } f() gives 1.
Global and eval code stays in the collector's roots while its
declarations are made, so a collection in that time keeps the code's
heap charge.