code: private static boolean mayBeStatementNoReturn(Node n) {
      switch (n.getToken()) {
        case EMPTY:
        case FUNCTION:
          // EMPTY and FUNCTION are used both in expression and statement
          // contexts
          return true;
  
        case BLOCK:
        case BREAK:
        case CLASS:
        case CONST:
        case CONTINUE:
        case DEBUGGER:
        case DO:
        case EXPR_RESULT:
        case FOR:
        case FOR_IN:
        case FOR_OF:
        case FOR_AWAIT_OF:
        case IF:
        case LABEL:
        case LET:
        case SWITCH:
        case THROW:
        case TRY:
        case VAR:
        case WHILE:
        case WITH:
          return true;
  
        default:
          return false;
      }
    }
docs: It isn't possible to always determine if a detached node is a expression,
  so make a best guess.