code: public Set<JSModule> getAllDependencies() {
      // JSModule uses identity semantics
      Set<JSModule> allDeps = Sets.newIdentityHashSet();
      allDeps.addAll(deps);
      ArrayDeque<JSModule> stack = new ArrayDeque<>(deps);
  
      while (!stack.isEmpty()) {
        JSModule module = stack.pop();
        List<JSModule> moduleDeps = module.deps;
        for (JSModule dep : moduleDeps) {
          if (allDeps.add(dep)) {
            stack.push(dep);
          }
        }
      }
      return allDeps;
    }
docs: Returns the transitive closure of dependencies starting from the
  dependencies of this module.