src/com/google/javascript/jscomp/NodeUtil.java
/**
   * A check inside a block to see if there are const, let, class, or function declarations
   * to be safe and not hoist them into the upper block.
   * @return Whether the block can be removed
   */
A check inside a block to see if there are const, let, class, or function declarations
to be safe and not hoist them into the upper block.
@return Whether the block can be removed
A check inside a block to see if there are const let class or function declarations to be safe and not hoist them into the upper block . @return Whether the block can be removed
public static boolean canMergeBlock(Node block) {
    for (Node c = block.getFirstChild(); c != null; c = c.getNext()) {
      switch (c.getToken()) {
        case LABEL:
          if (canMergeBlock(c)){
            continue;
          } else {
            return false;
          }
        case CONST:
        case LET:
        case CLASS:
        case FUNCTION:
          return false;
        default:
          continue;
      }
    }
    return true;
  }
public static boolean canMergeBlock ( Node block ) { for ( Node c = block . getFirstChild ( ) ; c != null ; c = c . getNext ( ) ) { switch ( c . getToken ( ) ) { case LABEL : if ( canMergeBlock ( c ) ) { continue ; } else { return false ; } case CONST : case LET : case CLASS : case FUNCTION : return false ; default : continue ; } } return true ; }
A check inside a block to see if there are const, let, class, or function declarations
 to be safe and not hoist them into the upper block.
A check inside a block to see if there are const let class or function declarations to be safe and not hoist them into the upper block .