code: static boolean isBlockScopedDeclaration(Node n) {
      if (n.isName()) {
        switch (n.getParent().getToken()) {
          case LET:
          case CONST:
          case CATCH:
            return true;
          case CLASS:
            return n.getParent().getFirstChild() == n;
          case FUNCTION:
            return isBlockScopedFunctionDeclaration(n.getParent());
          default:
            break;
        }
      }
      return false;
    }
docs: Is this node the name of a block-scoped declaration?
  Checks for let, const, class, or block-scoped function declarations.
  
  @param n The node
  @return True if {@code n} is the NAME of a block-scoped declaration.