src/com/google/javascript/jscomp/NodeUtil.java
/**
   * Removes any scope nodes from the provided list that are nested within some other scope node
   * also in the list. Returns the modified list.
   */
Removes any scope nodes from the provided list that are nested within some other scope node
also in the list. Returns the modified list.
Removes any scope nodes from the provided list that are nested within some other scope node also in the list . Returns the modified list .
public static List<Node> removeNestedChangeScopeNodes(List<Node> scopeNodes) {
    Set<Node> uniqueScopeNodes = new LinkedHashSet<>(scopeNodes);
    for (Node scopeNode : scopeNodes) {
      for (Node ancestor = scopeNode.getParent();
          ancestor != null;
          ancestor = ancestor.getParent()) {
        if (isChangeScopeRoot(ancestor) && uniqueScopeNodes.contains(ancestor)) {
          uniqueScopeNodes.remove(scopeNode);
          break;
        }
      }
    }
    return new ArrayList<>(uniqueScopeNodes);
  }
public static List < Node > removeNestedChangeScopeNodes ( List < Node > scopeNodes ) { Set < Node > uniqueScopeNodes = new LinkedHashSet < > ( scopeNodes ) ; for ( Node scopeNode : scopeNodes ) { for ( Node ancestor = scopeNode . getParent ( ) ; ancestor != null ; ancestor = ancestor . getParent ( ) ) { if ( isChangeScopeRoot ( ancestor ) && uniqueScopeNodes . contains ( ancestor ) ) { uniqueScopeNodes . remove ( scopeNode ) ; break ; } } } return new ArrayList < > ( uniqueScopeNodes ) ; }
Removes any scope nodes from the provided list that are nested within some other scope node
 also in the list.
Removes any scope nodes from the provided list that are nested within some other scope node also in the list .