B2G/gecko/browser/devtools/debugger/debugger-view.js
/**
   * Prepares a script to be added to the scripts container. This allows
   * for a large number of scripts to be batched up before being
   * alphabetically sorted and added in the container.
   * @see ScriptsView.commitScripts
   *
   * If aForceFlag is true, the script will be immediately inserted at the
   * necessary position in the container so that all the scripts remain sorted.
   * This can be much slower than batching up multiple scripts.
   *
   * @param string aLabel
   *        The simplified script location to be shown.
   * @param string aScript
   *        The source script.
   * @param boolean aForceFlag
   *        True to force the script to be immediately added.
   */
Prepares a script to be added to the scripts container. This allows
for a large number of scripts to be batched up before being
alphabetically sorted and added in the container.

If aForceFlag is true, the script will be immediately inserted at the
necessary position in the container so that all the scripts remain sorted.
This can be much slower than batching up multiple scripts.

@param string aLabel
The simplified script location to be shown.
@param string aScript
The source script.
@param boolean aForceFlag
True to force the script to be immediately added.
Prepares a script to be added to the scripts container . This allows for a large number of scripts to be batched up before being alphabetically sorted and added in the container . If aForceFlag is true the script will be immediately inserted at the necessary position in the container so that all the scripts remain sorted . This can be much slower than batching up multiple scripts . @param string aLabel The simplified script location to be shown . @param string aScript The source script . @param boolean aForceFlag True to force the script to be immediately added .
function DVS_addScript(aLabel, aScript, aForceFlag) {
    if (!aForceFlag) {
      this._tmpScripts.push({ label: aLabel, script: aScript });
      return;
    }
    for (let i = 0, l = this._scripts.itemCount; i < l; i++) {
      if (this._scripts.getItemAtIndex(i).label > aLabel) {
        this._createScriptElement(aLabel, aScript, i);
        return;
      }
    }
    this._createScriptElement(aLabel, aScript, -1);
  }
function DVS_addScript ( aLabel , aScript , aForceFlag ) { if ( ! aForceFlag ) { this . _tmpScripts . push ( { label : aLabel , script : aScript } ) ; return ; } for ( let i = 0 , l = this . _scripts . itemCount ; i < l ; i ++ ) { if ( this . _scripts . getItemAtIndex ( i ) . label > aLabel ) { this . _createScriptElement ( aLabel , aScript , i ) ; return ; } } this . _createScriptElement ( aLabel , aScript , - 1 ) ; }
Prepares a script to be added to the scripts container.
Prepares a script to be added to the scripts container .
// Batch the script to be added later. // Find the target position in the menulist and insert the script there. // The script is alphabetically the last one.