public static boolean mayThrowException ( Node n ) { switch ( n . getToken ( ) ) { case CALL : case TAGGED_TEMPLATELIT : case GETPROP : case GETELEM : case THROW : case NEW : case ASSIGN : case INC : case DEC : case INSTANCEOF : case IN : case YIELD : case AWAIT : return true ; case FUNCTION : return false ; default : break ; } for ( Node c = n . getFirstChild ( ) ; c != null ; c = c . getNext ( ) ) { if ( ! ControlFlowGraph . isEnteringNewCfgNode ( c ) && mayThrowException ( c ) ) { return true ; } } return false ; }
Determines if the subtree might throw an exception .