B2G/gecko/toolkit/components/places/tests/queries/test_querySerialization.js
/**
 * Convenience function for nsINavHistoryQuery switches that act as flags.  This
 * is attached to switch objects.  See querySwitches array above.
 *
 * @param  aQuery1
 *         an nsINavHistoryQuery object
 * @param  aQuery2
 *         another nsINavHistoryQuery object
 * @return true if this switch is the same in both aQuery1 and aQuery2
 */
Convenience function for nsINavHistoryQuery switches that act as flags.  This
is attached to switch objects.  See querySwitches array above.

@param  aQuery1
an nsINavHistoryQuery object
@param  aQuery2
another nsINavHistoryQuery object
@return true if this switch is the same in both aQuery1 and aQuery2
Convenience function for nsINavHistoryQuery switches that act as flags . This is attached to switch objects . See querySwitches array above . @param aQuery1 an nsINavHistoryQuery object @param aQuery2 another nsINavHistoryQuery object @return true if this switch is the same in both aQuery1 and aQuery2
function flagSwitchMatches(aQuery1, aQuery2)
{
  if (aQuery1[this.flag] && aQuery2[this.flag]) {
    for (let p in this.subswitches) {
      if (p in aQuery1 && p in aQuery2) {
        if (aQuery1[p] instanceof Ci.nsIURI) {
          if (!aQuery1[p].equals(aQuery2[p]))
            return false;
        }
        else if (aQuery1[p] !== aQuery2[p])
          return false;
      }
    }
  }
  else if (aQuery1[this.flag] || aQuery2[this.flag])
    return false;
  return true;
}
function flagSwitchMatches ( aQuery1 , aQuery2 ) { if ( aQuery1 [ this . flag ] && aQuery2 [ this . flag ] ) { for ( let p in this . subswitches ) { if ( p in aQuery1 && p in aQuery2 ) { if ( aQuery1 [ p ] instanceof Ci . nsIURI ) { if ( ! aQuery1 [ p ] . equals ( aQuery2 [ p ] ) ) return false ; } else if ( aQuery1 [ p ] !== aQuery2 [ p ] ) return false ; } } } else if ( aQuery1 [ this . flag ] || aQuery2 [ this . flag ] ) return false ; return true ; }
Convenience function for nsINavHistoryQuery switches that act as flags.
Convenience function for nsINavHistoryQuery switches that act as flags .