code: public String getScriptStackTrace(int limit, String functionName)
      {
          ScriptStackElement[] stack = getScriptStack(limit, functionName);
          return formatStackTrace(stack, details());
      }
docs: Get a string representing the script stack of this exception.
  If optimization is enabled, this includes java stack elements
  whose source and method names suggest they have been generated
  by the Rhino script compiler.
  The optional "limit" parameter limits the number of stack frames returned.
  The "functionName" parameter will exclude any stack frames "below" the
  specified function on the stack.
  
  @param limit the number of stack frames returned
  @param functionName the name of a function on the stack -- frames below it will be ignored
  @return a script stack dump
  @since 1.8.0