code: private void findDeclaredNames(NodeTraversal t, Node n) {
      checkState(NodeUtil.createsScope(n) || n.isScript(), n);
  
      for (Var v : t.getScope().getVarIterable()) {
        renamerStack.peek().addDeclaredName(v.getName(), false);
      }
    }
docs: Traverses the current scope and collects declared names by calling {@code addDeclaredName} on
  the {@code Renamer} that is at the top of the {@code renamerStack}.