static boolean createsBlockScope ( Node n ) { switch ( n . getToken ( ) ) { case BLOCK : Node parent = n . getParent ( ) ; // Don't create block scope for switch cases or catch blocks. return parent != null && ! isSwitchCase ( parent ) && ! parent . isCatch ( ) ; case FOR : case FOR_IN : case FOR_OF : case FOR_AWAIT_OF : case SWITCH : case CLASS : return true ; default : return false ; } }
A block scope is created by a non - synthetic block node a for loop node or a for - of loop node .