B2G/gecko/toolkit/devtools/debugger/server/dbg-script-actors.js
/**
   * Add the provided script to the server cache.
   *
   * @param aScript Debugger.Script
   *        The source script that will be stored.
   * @returns true, if the script was added, false otherwise.
   */
Add the provided script to the server cache.
@param aScript Debugger.Script
The source script that will be stored.
@returns true, if the script was added, false otherwise.
Add the provided script to the server cache . @param aScript Debugger . Script The source script that will be stored . @returns true if the script was added false otherwise .
function TA__addScript(aScript) {
    if (aScript.url.indexOf("chrome://") == 0) {
      return false;
    }
    if (aScript.url.indexOf("about:") == 0) {
      return false;
    }
    if (!this._scripts[aScript.url]) {
      this._scripts[aScript.url] = [];
    }
    this._scripts[aScript.url][aScript.startLine] = aScript;
    let existing = this._breakpointStore[aScript.url];
    if (existing) {
      let endLine = aScript.startLine + aScript.lineCount - 1;
      for (let line = existing.length - 1; line >= 0; line--) {
        let bp = existing[line];
        if (bp && line >= aScript.startLine && line <= endLine) {
          this._setBreakpoint(bp);
        }
      }
    }
    return true;
  }
function TA__addScript ( aScript ) { if ( aScript . url . indexOf ( "chrome://" ) == 0 ) { return false ; } if ( aScript . url . indexOf ( "about:" ) == 0 ) { return false ; } if ( ! this . _scripts [ aScript . url ] ) { this . _scripts [ aScript . url ] = [ ] ; } this . _scripts [ aScript . url ] [ aScript . startLine ] = aScript ; let existing = this . _breakpointStore [ aScript . url ] ; if ( existing ) { let endLine = aScript . startLine + aScript . lineCount - 1 ; for ( let line = existing . length - 1 ; line >= 0 ; line -- ) { let bp = existing [ line ] ; if ( bp && line >= aScript . startLine && line <= endLine ) { this . _setBreakpoint ( bp ) ; } } } return true ; }
Add the provided script to the server cache.
Add the provided script to the server cache .
// Ignore XBL bindings for content debugging. // Ignore about:* pages for content debugging. // Use a sparse array for storing the scripts for each URL in order to // optimize retrieval. // Set any stored breakpoints. // Iterate over the lines backwards, so that sliding breakpoints don't // affect the loop. // Limit search to the line numbers contained in the new script.