B2G/gecko/browser/components/places/src/PlacesUIUtils.jsm
// Removes an item and associated annotations, ignoring eventual errors.
Removes an item and associated annotations, ignoring eventual errors.
Removes an item and associated annotations ignoring eventual errors .
function safeRemoveItem(aItemId) {
      try {
        if (as.itemHasAnnotation(aItemId, PlacesUIUtils.ORGANIZER_QUERY_ANNO) &&
            !(as.getItemAnnotation(aItemId, PlacesUIUtils.ORGANIZER_QUERY_ANNO) in queries)) {
          return;
        }
        as.removeItemAnnotation(aItemId, PlacesUIUtils.ORGANIZER_FOLDER_ANNO);
        as.removeItemAnnotation(aItemId, PlacesUIUtils.ORGANIZER_QUERY_ANNO);
        bs.removeItem(aItemId);
      }
      catch(e) {  }
    }
function safeRemoveItem ( aItemId ) { try { if ( as . itemHasAnnotation ( aItemId , PlacesUIUtils . ORGANIZER_QUERY_ANNO ) && ! ( as . getItemAnnotation ( aItemId , PlacesUIUtils . ORGANIZER_QUERY_ANNO ) in queries ) ) { return ; } as . removeItemAnnotation ( aItemId , PlacesUIUtils . ORGANIZER_FOLDER_ANNO ) ; as . removeItemAnnotation ( aItemId , PlacesUIUtils . ORGANIZER_QUERY_ANNO ) ; bs . removeItem ( aItemId ) ; } catch ( e ) { } }
Removes an item and associated annotations, ignoring eventual errors.
Removes an item and associated annotations ignoring eventual errors .
// Some extension annotated their roots with our query annotation, // so we should not delete them. // removeItemAnnotation does not check if item exists, nor the anno, // so this is safe to do. // This will throw if the annotation is an orphan. /* orphan anno */