docs: public ScriptStackElement[] getScriptStack(int limit, String hideFunction) {
          List<ScriptStackElement> list = new ArrayList<ScriptStackElement>();
          ScriptStackElement[][] interpreterStack = null;
          if (interpreterStackInfo != null) {
              Evaluator interpreter = Context.createInterpreter();
              if (interpreter instanceof Interpreter)
                  interpreterStack = ((Interpreter) interpreter).getScriptStackElements(this);
          }
  
          int interpreterStackIndex = 0;
          StackTraceElement[] stack = getStackTrace();
          int count = 0;
          boolean printStarted = (hideFunction == null);
  
          // Pattern to recover function name from java method name -
          // see Codegen.getBodyMethodName()
          // kudos to Marc Guillemot for coming up with this
          for (StackTraceElement e : stack) {
              String fileName = e.getFileName();
              if (e.getMethodName().startsWith("_c_")
                      && e.getLineNumber() > -1
                      && fileName != null
                      && !fileName.endsWith(".java")) {
                  String methodName = e.getMethodName();
                  Matcher match = JAVA_STACK_PATTERN.matcher(methodName);
                  // the method representing the main script is always "_c_script_0" -
                  // at least we hope so
                  methodName = !"_c_script_0".equals(methodName) && match.find() ?
                          match.group(1) : null;
  
                  if (!printStarted && hideFunction.equals(methodName)) {
                      printStarted = true;
                  } else if (printStarted && ((limit < 0) || (count < limit))) {
                      list.add(new ScriptStackElement(fileName, methodName, e.getLineNumber()));
                      count++;
                  }
  
              } else if ("org.mozilla.javascript.Interpreter".equals(e.getClassName())
                      && "interpretLoop".equals(e.getMethodName())
                      && interpreterStack != null
                      && interpreterStack.length > interpreterStackIndex) {
  
                  for (ScriptStackElement elem : interpreterStack[interpreterStackIndex++]) {
                      if (!printStarted && hideFunction.equals(elem.functionName)) {
                          printStarted = true;
                      } else if (printStarted && ((limit < 0) || (count < limit))) {
                          list.add(elem);
                          count++;
                      }
                  }
              }
          }
          return list.toArray(new ScriptStackElement[list.size()]);
      }