B2G/gecko/toolkit/devtools/debugger/server/dbg-script-actors.js
/**
   * Get the innermost script that contains this line, by looking through child
   * scripts of the supplied script.
   *
   * @param aScript Debugger.Script
   *        The source script.
   * @param aLine number
   *        The line number.
   */
Get the innermost script that contains this line, by looking through child
scripts of the supplied script.

@param aScript Debugger.Script
The source script.
@param aLine number
The line number.
Get the innermost script that contains this line by looking through child scripts of the supplied script . @param aScript Debugger . Script The source script . @param aLine number The line number .
function TA__getInnermostContainer(aScript, aLine) {
    let children = aScript.getChildScripts();
    if (children.length > 0) {
      for (let i = 0; i < children.length; i++) {
        let child = children[i];
        if (child.startLine <= aLine &&
            child.startLine + child.lineCount > aLine) {
          return this._getInnermostContainer(child, aLine);
        }
      }
    }
    return aScript;
  }
function TA__getInnermostContainer ( aScript , aLine ) { let children = aScript . getChildScripts ( ) ; if ( children . length > 0 ) { for ( let i = 0 ; i < children . length ; i ++ ) { let child = children [ i ] ; if ( child . startLine <= aLine && child . startLine + child . lineCount > aLine ) { return this . _getInnermostContainer ( child , aLine ) ; } } } return aScript ; }
Get the innermost script that contains this line, by looking through child
 scripts of the supplied script.
Get the innermost script that contains this line by looking through child scripts of the supplied script .
// Stop when the first script that contains this location is found. // Location not found in children, this is the innermost containing script.