B2G/gecko/browser/devtools/webconsole/webconsole.js
/**
   * Ensures that the number of message nodes of type aCategory don't exceed that
   * category's line limit by removing old messages as needed.
   *
   * @param integer aCategory
   *        The category of message nodes to prune if needed.
   * @return number
   *         The number of removed nodes.
   */
Ensures that the number of message nodes of type aCategory don't exceed that
category's line limit by removing old messages as needed.

@param integer aCategory
The category of message nodes to prune if needed.
@return number
The number of removed nodes.
Ensures that the number of message nodes of type aCategory don ' t exceed that category ' s line limit by removing old messages as needed . @param integer aCategory The category of message nodes to prune if needed . @return number The number of removed nodes .
function WCF_pruneOutputIfNecessary(aCategory)
  {
    let outputNode = this.outputNode;
    let logLimit = Utils.logLimitForCategory(aCategory);
    let messageNodes = outputNode.getElementsByClassName("webconsole-msg-" +
        CATEGORY_CLASS_FRAGMENTS[aCategory]);
    let n = Math.max(0, messageNodes.length - logLimit);
    let toRemove = Array.prototype.slice.call(messageNodes, 0, n);
    toRemove.forEach(this.removeOutputMessage, this);
    return n;
  }
function WCF_pruneOutputIfNecessary ( aCategory ) { let outputNode = this . outputNode ; let logLimit = Utils . logLimitForCategory ( aCategory ) ; let messageNodes = outputNode . getElementsByClassName ( "webconsole-msg-" + CATEGORY_CLASS_FRAGMENTS [ aCategory ] ) ; let n = Math . max ( 0 , messageNodes . length - logLimit ) ; let toRemove = Array . prototype . slice . call ( messageNodes , 0 , n ) ; toRemove . forEach ( this . removeOutputMessage , this ) ; return n ; }
Ensures that the number of message nodes of type aCategory don't exceed that
 category's line limit by removing old messages as needed.
Ensures that the number of message nodes of type aCategory don ' t exceed that category ' s line limit by removing old messages as needed .