B2G/gecko/toolkit/mozapps/extensions/AddonManager.jsm
/**
   * Calls all registered AddonListeners with an event. Any parameters after
   * the method parameter are passed to the listener.
   *
   * @param  aMethod
   *         The method on the listeners to call
   */
Calls all registered AddonListeners with an event. Any parameters after
the method parameter are passed to the listener.

@param  aMethod
The method on the listeners to call
Calls all registered AddonListeners with an event . Any parameters after the method parameter are passed to the listener . @param aMethod The method on the listeners to call
function AMI_callAddonListeners(aMethod, ...aArgs) {
    if (!gStarted)
      throw Components.Exception("AddonManager is not initialized",
                                 Cr.NS_ERROR_NOT_INITIALIZED);
    if (!aMethod || typeof aMethod != "string")
      throw Components.Exception("aMethod must be a non-empty string",
                                 Cr.NS_ERROR_INVALID_ARG);
    let addonListeners = this.addonListeners.slice(0);
    for (let listener of addonListeners) {
      try {
        if (aMethod in listener)
          listener[aMethod].apply(listener, aArgs);
      }
      catch (e) {
        WARN("AddonListener threw exception when calling " + aMethod, e);
      }
    }
  }
function AMI_callAddonListeners ( aMethod , ... aArgs ) { if ( ! gStarted ) throw Components . Exception ( "AddonManager is not initialized" , Cr . NS_ERROR_NOT_INITIALIZED ) ; if ( ! aMethod || typeof aMethod != "string" ) throw Components . Exception ( "aMethod must be a non-empty string" , Cr . NS_ERROR_INVALID_ARG ) ; let addonListeners = this . addonListeners . slice ( 0 ) ; for ( let listener of addonListeners ) { try { if ( aMethod in listener ) listener [ aMethod ] . apply ( listener , aArgs ) ; } catch ( e ) { WARN ( "AddonListener threw exception when calling " + aMethod , e ) ; } } }
Calls all registered AddonListeners with an event.
Calls all registered AddonListeners with an event .