org.mozilla.javascript.Context.getSourcePositionFromStack()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 JavaScript  
字(6.6k)|赞(0)|评价(0)|浏览(135)

本文整理了Java中org.mozilla.javascript.Context.getSourcePositionFromStack()方法的一些代码示例,展示了Context.getSourcePositionFromStack()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Context.getSourcePositionFromStack()方法的具体详情如下:
包路径:org.mozilla.javascript.Context
类名称:Context
方法名:getSourcePositionFromStack

Context.getSourcePositionFromStack介绍

暂无

代码示例

代码示例来源:origin: rhino/js

/**
 * Report a warning using the error reporter for the current thread.
 *
 * @param message the warning message to report
 * @see org.mozilla.javascript.ErrorReporter
 */
public static void reportWarning(String message)
{
  int[] linep = { 0 };
  String filename = getSourcePositionFromStack(linep);
  Context.reportWarning(message, filename, linep[0], null, 0);
}

代码示例来源:origin: rhino/js

public static void reportWarning(String message, Throwable t)
{
  int[] linep = { 0 };
  String filename = getSourcePositionFromStack(linep);
  Writer sw = new StringWriter();
  PrintWriter pw = new PrintWriter(sw);
  pw.println(message);
  t.printStackTrace(pw);
  pw.flush();
  Context.reportWarning(sw.toString(), filename, linep[0], null, 0);
}

代码示例来源:origin: rhino/js

/**
 * Report an error using the error reporter for the current thread.
 *
 * @param message the error message to report
 * @see org.mozilla.javascript.ErrorReporter
 */
public static void reportError(String message)
{
  int[] linep = { 0 };
  String filename = getSourcePositionFromStack(linep);
  Context.reportError(message, filename, linep[0], null, 0);
}

代码示例来源:origin: rhino/js

public static EcmaError constructError(String error, String message)
{
  int[] linep = new int[1];
  String filename = Context.getSourcePositionFromStack(linep);
  return constructError(error, message, filename, linep[0], null, 0);
}

代码示例来源:origin: rhino/js

/**
 * Report a runtime error using the error reporter for the current thread.
 *
 * @param message the error message to report
 * @see org.mozilla.javascript.ErrorReporter
 */
public static EvaluatorException reportRuntimeError(String message)
{
  int[] linep = { 0 };
  String filename = getSourcePositionFromStack(linep);
  return Context.reportRuntimeError(message, filename, linep[0], null, 0);
}

代码示例来源:origin: ro.isdc.wro4j/rhino

public static void reportWarning(String message, Throwable t)
{
  int[] linep = { 0 };
  String filename = getSourcePositionFromStack(linep);
  Writer sw = new StringWriter();
  PrintWriter pw = new PrintWriter(sw);
  pw.println(message);
  t.printStackTrace(pw);
  pw.flush();
  Context.reportWarning(sw.toString(), filename, linep[0], null, 0);
}

代码示例来源:origin: ro.isdc.wro4j/rhino

/**
 * Report an error using the error reporter for the current thread.
 *
 * @param message the error message to report
 * @see org.mozilla.javascript.ErrorReporter
 */
public static void reportError(String message)
{
  int[] linep = { 0 };
  String filename = getSourcePositionFromStack(linep);
  Context.reportError(message, filename, linep[0], null, 0);
}

代码示例来源:origin: ro.isdc.wro4j/rhino

public static EcmaError constructError(String error,
                    String message,
                    int lineNumberDelta)
{
  int[] linep = new int[1];
  String filename = Context.getSourcePositionFromStack(linep);
  if (linep[0] != 0) {
    linep[0] += lineNumberDelta;
  }
  return constructError(error, message, filename, linep[0], null, 0);
}

代码示例来源:origin: geogebra/geogebra

/**
 * Report a warning using the error reporter for the current thread.
 *
 * @param message the warning message to report
 * @see org.mozilla.javascript.ErrorReporter
 */
public static void reportWarning(String message)
{
  int[] linep = { 0 };
  String filename = getSourcePositionFromStack(linep);
  Context.reportWarning(message, filename, linep[0], null, 0);
}

代码示例来源:origin: geogebra/geogebra

public static void reportWarning(String message, Throwable t)
{
  int[] linep = { 0 };
  String filename = getSourcePositionFromStack(linep);
  Writer sw = new StringWriter();
  PrintWriter pw = new PrintWriter(sw);
  pw.println(message);
  t.printStackTrace(pw);
  pw.flush();
  Context.reportWarning(sw.toString(), filename, linep[0], null, 0);
}

代码示例来源:origin: geogebra/geogebra

/**
 * Report an error using the error reporter for the current thread.
 *
 * @param message the error message to report
 * @see org.mozilla.javascript.ErrorReporter
 */
public static void reportError(String message)
{
  int[] linep = { 0 };
  String filename = getSourcePositionFromStack(linep);
  Context.reportError(message, filename, linep[0], null, 0);
}

代码示例来源:origin: geogebra/geogebra

/**
 * Report a runtime error using the error reporter for the current thread.
 *
 * @param message the error message to report
 * @see org.mozilla.javascript.ErrorReporter
 */
public static EvaluatorException reportRuntimeError(String message)
{
  int[] linep = { 0 };
  String filename = getSourcePositionFromStack(linep);
  return Context.reportRuntimeError(message, filename, linep[0], null, 0);
}

代码示例来源:origin: geogebra/geogebra

public static EcmaError constructError(String error, String message)
{
  int[] linep = new int[1];
  String filename = Context.getSourcePositionFromStack(linep);
  return constructError(error, message, filename, linep[0], null, 0);
}

代码示例来源:origin: geogebra/geogebra

public static EcmaError constructError(String error,
                    String message,
                    int lineNumberDelta)
{
  int[] linep = new int[1];
  String filename = Context.getSourcePositionFromStack(linep);
  if (linep[0] != 0) {
    linep[0] += lineNumberDelta;
  }
  return constructError(error, message, filename, linep[0], null, 0);
}

代码示例来源:origin: rhino/js

public static EcmaError constructError(String error,
                    String message,
                    int lineNumberDelta)
{
  int[] linep = new int[1];
  String filename = Context.getSourcePositionFromStack(linep);
  if (linep[0] != 0) {
    linep[0] += lineNumberDelta;
  }
  return constructError(error, message, filename, linep[0], null, 0);
}

代码示例来源:origin: io.apigee/rhino

public static EcmaError constructError(String error, String message)
{
  int[] linep = new int[1];
  String filename = Context.getSourcePositionFromStack(linep);
  return constructError(error, message, filename, linep[0], null, 0);
}

代码示例来源:origin: io.apigee/rhino

/**
 * Report a warning using the error reporter for the current thread.
 *
 * @param message the warning message to report
 * @see org.mozilla.javascript.ErrorReporter
 */
public static void reportWarning(String message)
{
  int[] linep = { 0 };
  String filename = getSourcePositionFromStack(linep);
  Context.reportWarning(message, filename, linep[0], null, 0);
}

代码示例来源:origin: com.sun.phobos/phobos-rhino

public static void reportWarning(String message, Throwable t)
{
  int[] linep = { 0 };
  String filename = getSourcePositionFromStack(linep);
  Writer sw = new StringWriter();
  PrintWriter pw = new PrintWriter(sw);
  pw.println(message);
  t.printStackTrace(pw);
  pw.flush();
  Context.reportWarning(sw.toString(), filename, linep[0], null, 0);
}

代码示例来源:origin: com.github.tntim96/rhino

public static EcmaError constructError(String error,
                    String message,
                    int lineNumberDelta)
{
  int[] linep = new int[1];
  String filename = Context.getSourcePositionFromStack(linep);
  if (linep[0] != 0) {
    linep[0] += lineNumberDelta;
  }
  return constructError(error, message, filename, linep[0], null, 0);
}

代码示例来源:origin: io.apigee/rhino

public static EcmaError constructError(String error,
                    String message,
                    int lineNumberDelta)
{
  int[] linep = new int[1];
  String filename = Context.getSourcePositionFromStack(linep);
  if (linep[0] != 0) {
    linep[0] += lineNumberDelta;
  }
  return constructError(error, message, filename, linep[0], null, 0);
}

相关文章

微信公众号

Context类方法