B2G/gecko/browser/components/places/content/controller.js
/**
   * Walk the list of folders we're removing in this delete operation, and
   * see if the selected node specified is already implicitly being removed
   * because it is a child of that folder.
   * @param   node
   *          Node to check for containment.
   * @param   pastFolders
   *          List of folders the calling function has already traversed
   * @returns true if the node should be skipped, false otherwise.
   */
Walk the list of folders we're removing in this delete operation, and
see if the selected node specified is already implicitly being removed
because it is a child of that folder.
@param   node
Node to check for containment.
@param   pastFolders
List of folders the calling function has already traversed
@returns true if the node should be skipped, false otherwise.
Walk the list of folders we ' re removing in this delete operation and see if the selected node specified is already implicitly being removed because it is a child of that folder . @param node Node to check for containment . @param pastFolders List of folders the calling function has already traversed @returns true if the node should be skipped false otherwise .
function PC_shouldSkipNode(node, pastFolders) {
    function isContainedBy(node, parent) {
      var cursor = node.parent;
      while (cursor) {
        if (cursor == parent)
          return true;
        cursor = cursor.parent;
      }
      return false;
    }
      for (var j = 0; j < pastFolders.length; ++j) {
        if (isContainedBy(node, pastFolders[j]))
          return true;
      }
      return false;
  }
function PC_shouldSkipNode ( node , pastFolders ) { function isContainedBy ( node , parent ) { var cursor = node . parent ; while ( cursor ) { if ( cursor == parent ) return true ; cursor = cursor . parent ; } return false ; } for ( var j = 0 ; j < pastFolders . length ; ++ j ) { if ( isContainedBy ( node , pastFolders [ j ] ) ) return true ; } return false ; }
Walk the list of folders we're removing in this delete operation, and
 see if the selected node specified is already implicitly being removed
 because it is a child of that folder.
Walk the list of folders we ' re removing in this delete operation and see if the selected node specified is already implicitly being removed because it is a child of that folder .
/**
     * Determines if a node is contained by another node within a resultset.
     * @param   node
     *          The node to check for containment for
     * @param   parent
     *          The parent container to check for containment in
     * @returns true if node is a member of parent's children, false otherwise.
     */