[Refactoring] Use visitor in Statement::blockExit
Add FuncDeclaration paramter to canThrow and blockExit to represent enclosing function
fix Issue 12542 - No function attribute inference for recursive functions
Merge pull request #3436 from 9rnsr/fix12542

Issue 12542 - No function attribute inference for recursive functions