code: function (startDir, startDirIsObject) {
              var topDir = startDir,
                  dirFileArray, fileObj;
  
              if (!startDirIsObject) {
                  topDir = xpfile(startDir);
              }
  
              if (topDir.exists()) {
                  dirFileArray = topDir.directoryEntries;
                  while (dirFileArray.hasMoreElements()) {
                      fileObj = dirFileArray.getNext().QueryInterface(Ci.nsILocalFile);
  
                      if (fileObj.isDirectory()) {
                          file.deleteEmptyDirs(fileObj, true);
                      }
                  }
  
                  //If the directory is empty now, delete it.
                  dirFileArray = topDir.directoryEntries;
                  if (!dirFileArray.hasMoreElements()) {
                      file.deleteFile(topDir.path);
                  }
              }
          }
docs: Deletes any empty directories under the given directory.
  The startDirIsJavaObject is private to this implementation's
  recursion needs.