 diff --git a/src/com/google/javascript/jscomp/MakeDeclaredNamesUnique.java b/src/com/google/javascript/jscomp/MakeDeclaredNamesUnique.java
-index d88520cb..e4f1c205 100644
+index d88520cb..51f440c2 100644
 --- a/src/com/google/javascript/jscomp/MakeDeclaredNamesUnique.java
 +++ b/src/com/google/javascript/jscomp/MakeDeclaredNamesUnique.java
 @@ -23,7 +23,7 @@ import com.google.common.collect.Lists;

   }
 
   /**
@@ -411,7 +383,6 @@ class MakeDeclaredNamesUnique
      */
     @Override
     public void addDeclaredName(String name) {

      */
-    public void exitScope(NodeTraversal t) {
-      if (t.inGlobalScope()) {
+    @Override
+    public void visit(NodeTraversal t, Node node, Node parent) {
+      if (node.getType() == Token.NAME) {
+        String oldName = node.getString();
+        if (containsSeparator(oldName)) {
+          Scope scope = t.getScope();
+          Var var = t.getScope().getVar(oldName);
+          if (var == null || var.isGlobal()) {
         return;
       }
 
-      for (Iterator<Var> it = t.getScope().getVars(); it.hasNext();) {
-        Var v = it.next();
