code: private boolean shouldEmitDeprecationWarning(NodeTraversal t, Node n) {
      // In the global scope, there are only two kinds of accesses that should
      // be flagged for warnings:
      // 1) Calls of deprecated functions and methods.
      // 2) Instantiations of deprecated classes.
      // For now, we just let everything else by.
      if (t.inGlobalScope()) {
        if (!NodeUtil.isInvocationTarget(n) && !n.isNew()) {
          return false;
        }
      }
  
      return !canAccessDeprecatedTypes(t);
    }
docs: Determines whether a deprecation warning should be emitted.
  
  @param t The current traversal.
  @param n The node which we are checking.
  @param parent The parent of the node which we are checking.