B2G/gecko/toolkit/components/places/tests/queries/test_querySerialization.js
/**
 * Tests if aObj1 and aObj2 are equal.  This function is general and may be used
 * for either nsINavHistoryQuery or nsINavHistoryQueryOptions objects.  aSwitches
 * determines which set of switches is used for comparison.  Pass in either
 * querySwitches or queryOptionSwitches.
 *
 * @param  aSwitches
 *         determines which set of switches applies to aObj1 and aObj2, either
 *         querySwitches or queryOptionSwitches
 * @param  aObj1
 *         an nsINavHistoryQuery or nsINavHistoryQueryOptions object
 * @param  aObj2
 *         another nsINavHistoryQuery or nsINavHistoryQueryOptions object
 * @return true if aObj1 and aObj2 are equal
 */
Tests if aObj1 and aObj2 are equal.  This function is general and may be used
for either nsINavHistoryQuery or nsINavHistoryQueryOptions objects.  aSwitches
determines which set of switches is used for comparison.  Pass in either
querySwitches or queryOptionSwitches.

@param  aSwitches
determines which set of switches applies to aObj1 and aObj2, either
querySwitches or queryOptionSwitches
@param  aObj1
an nsINavHistoryQuery or nsINavHistoryQueryOptions object
@param  aObj2
another nsINavHistoryQuery or nsINavHistoryQueryOptions object
@return true if aObj1 and aObj2 are equal
Tests if aObj1 and aObj2 are equal . This function is general and may be used for either nsINavHistoryQuery or nsINavHistoryQueryOptions objects . aSwitches determines which set of switches is used for comparison . Pass in either querySwitches or queryOptionSwitches . @param aSwitches determines which set of switches applies to aObj1 and aObj2 either querySwitches or queryOptionSwitches @param aObj1 an nsINavHistoryQuery or nsINavHistoryQueryOptions object @param aObj2 another nsINavHistoryQuery or nsINavHistoryQueryOptions object @return true if aObj1 and aObj2 are equal
function queryObjsEqual(aSwitches, aObj1, aObj2)
{
  for (let i = 0; i < aSwitches.length; i++) {
    if (!aSwitches[i].matches(aObj1, aObj2))
      return false;
  }
  return true;
}
function queryObjsEqual ( aSwitches , aObj1 , aObj2 ) { for ( let i = 0 ; i < aSwitches . length ; i ++ ) { if ( ! aSwitches [ i ] . matches ( aObj1 , aObj2 ) ) return false ; } return true ; }
Tests if aObj1 and aObj2 are equal.
Tests if aObj1 and aObj2 are equal .