bin/XULRunner21_0/components/nsUpdateService.js
/**
   * Returns an array of nsIUpdate objects discovered by the update check.
   * @throws if the XML document element node name is not updates.
   */
Returns an array of nsIUpdate objects discovered by the update check.
@throws if the XML document element node name is not updates.
Returns an array of nsIUpdate objects discovered by the update check . @throws if the XML document element node name is not updates .
get _updates() {
    var updatesElement = this._request.responseXML.documentElement;
    if (!updatesElement) {
      LOG("Checker:_updates get - empty updates document?!");
      return [];
    }
    if (updatesElement.nodeName != "updates") {
      LOG("Checker:updates get - unexpected node name!");
      throw new Error("Unexpected node name, expected: updates, got: " +
                      updatesElement.nodeName);
    }
    const ELEMENT_NODE = Ci.nsIDOMNode.ELEMENT_NODE;
    var updates = [];
    for (var i = 0; i < updatesElement.childNodes.length; ++i) {
      var updateElement = updatesElement.childNodes.item(i);
      if (updateElement.nodeType != ELEMENT_NODE ||
          updateElement.localName != "update")
        continue;
      updateElement.QueryInterface(Ci.nsIDOMElement);
      try {
        var update = new Update(updateElement);
      } catch (e) {
        LOG("Checker:updates get - invalid <update/>, ignoring...");
        continue;
      }
      update.serviceURL = this.getUpdateURL(this._forced);
      update.channel = UpdateChannel.get();
      updates.push(update);
    }
    return updates;
  }
get _updates ( ) { var updatesElement = this . _request . responseXML . documentElement ; if ( ! updatesElement ) { LOG ( "Checker:_updates get - empty updates document?!" ) ; return [ ] ; } if ( updatesElement . nodeName != "updates" ) { LOG ( "Checker:updates get - unexpected node name!" ) ; throw new Error ( "Unexpected node name, expected: updates, got: " + updatesElement . nodeName ) ; } const ELEMENT_NODE = Ci . nsIDOMNode . ELEMENT_NODE ; var updates = [ ] ; for ( var i = 0 ; i < updatesElement . childNodes . length ; ++ i ) { var updateElement = updatesElement . childNodes . item ( i ) ; if ( updateElement . nodeType != ELEMENT_NODE || updateElement . localName != "update" ) continue ; updateElement . QueryInterface ( Ci . nsIDOMElement ) ; try { var update = new Update ( updateElement ) ; } catch ( e ) { LOG ( "Checker:updates get - invalid <update/>, ignoring..." ) ; continue ; } update . serviceURL = this . getUpdateURL ( this . _forced ) ; update . channel = UpdateChannel . get ( ) ; updates . push ( update ) ; } return updates ; }
Returns an array of nsIUpdate objects discovered by the update check.
Returns an array of nsIUpdate objects discovered by the update check .