code: private void checkNameDeprecation(NodeTraversal t, Node n) {
      if (!n.isName()) {
        return;
      }
  
      if (!shouldEmitDeprecationWarning(t, n)) {
        return;
      }
  
      Var var = t.getScope().getVar(n.getString());
      JSDocInfo docInfo = var == null ? null : var.getJSDocInfo();
  
      if (docInfo != null && docInfo.isDeprecated()) {
        if (docInfo.getDeprecationReason() != null) {
          compiler.report(
              JSError.make(n, DEPRECATED_NAME_REASON, n.getString(), docInfo.getDeprecationReason()));
        } else {
          compiler.report(JSError.make(n, DEPRECATED_NAME, n.getString()));
        }
      }
    }
docs: Checks the given NAME node to ensure that access restrictions are obeyed.