code: 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;
      }
    }
docs: A block scope is created by a non-synthetic block node, a for loop node,
  or a for-of loop node.
  
  <p>Note: for functions, we use two separate scopes for parameters and
  declarations in the body. We need to make sure default parameters cannot
  reference var / function declarations in the body.
  
  @return Whether the node creates a block scope.