org.mozilla.javascript.JavaScriptException.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 JavaScript  
字(6.0k)|赞(0)|评价(0)|浏览(137)

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

JavaScriptException.<init>介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

trigger("var a=arguments[0];a.parentNode.removeChild(a);", anchor);
} else {
  throw new JavaScriptException(element, "Unable to open tab", 1);

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

public Object next() {
  if (!iterator.hasNext()) {
    // Out of values. Throw StopIteration.
    throw new JavaScriptException(
      NativeIterator.getStopIterationObject(scope), null, 0);
  }
  return iterator.next();
}

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

public Object next() {
  if (!iterator.hasNext()) {
    // Out of values. Throw StopIteration.
    throw new JavaScriptException(
      NativeIterator.getStopIterationObject(scope), null, 0);
  }
  return iterator.next();
}

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

public Object next() {
  if (!iterator.hasNext()) {
    // Out of values. Throw StopIteration.
    throw new JavaScriptException(
      NativeIterator.getStopIterationObject(scope), null, 0);
  }
  return iterator.next();
}

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

public Object next() {
  if (!iterator.hasNext()) {
    // Out of values. Throw StopIteration.
    throw new JavaScriptException(
      NativeIterator.getStopIterationObject(scope), null, 0);
  }
  return iterator.next();
}

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

public Object next() {
  if (!iterator.hasNext()) {
    // Out of values. Throw StopIteration.
    throw new JavaScriptException(
      NativeIterator.getStopIterationObject(scope), null, 0);
  }
  return iterator.next();
}

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

public static void throwStopIteration(Object obj) {
  throw new JavaScriptException(
    NativeIterator.getStopIterationObject((Scriptable)obj), "", 0);
}

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

public static void throwStopIteration(Object obj) {
  throw new JavaScriptException(
    NativeIterator.getStopIterationObject((Scriptable)obj), "", 0);
}

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

public static void throwStopIteration(Object obj) {
  throw new JavaScriptException(
    NativeIterator.getStopIterationObject((Scriptable)obj), "", 0);
}

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

public static void throwStopIteration(Object obj) {
  throw new JavaScriptException(
    NativeIterator.getStopIterationObject((Scriptable)obj), "", 0);
}

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

public static void throwStopIteration(Object obj) {
  throw new JavaScriptException(
    NativeIterator.getStopIterationObject((Scriptable)obj), "", 0);
}

代码示例来源:origin: org.apache.cocoon/cocoon-flowscript-impl

public void put(int index, Scriptable start, Object value) {
  // FIXME(SW): do indexed properties have a meaning on the global scope?
  if (this.locked && !has(index, start)) {
    throw new WrappedException(new JavaScriptException("Global scope locked. Cannot set value for index " + index));
  }
  this.useSession = true;
  super.put(index, start, value);
}

代码示例来源:origin: org.apache.cocoon/cocoon-flowscript-impl

public void put(String name, Scriptable start, Object value) {
  //Allow setting values to existing variables, or if this is a
  //java class (used by importClass & importPackage)
  if (this.locked && !has(name, start) && !(value instanceof NativeJavaClass) && !(value instanceof Function)) {
    // Need to wrap into a runtime exception as Scriptable.put has no throws clause...
    throw new WrappedException (new JavaScriptException("Implicit declaration of global variable '" + name +
     "' forbidden. Please ensure all variables are explicitely declared with the 'var' keyword"));
  }
  this.useSession = true;
  super.put(name, start, value);
}

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

/**
 * Equivalent to executing "new Error(message, sourceFileName, sourceLineNo)" from JavaScript.
 * @param cx the current context
 * @param scope the current scope
 * @param message the message
 * @return a JavaScriptException you should throw
 */
public static JavaScriptException throwError(Context cx, Scriptable scope,
    String message) {
 int[] linep = { 0 };
 String filename = Context.getSourcePositionFromStack(linep);
  final Scriptable error = newBuiltinObject(cx, scope,
      TopLevel.Builtins.Error, new Object[] { message, filename, Integer.valueOf(linep[0]) });
  return new JavaScriptException(error, filename, linep[0]);
}

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

private Object next(Context cx, Scriptable scope) {
  Boolean b = ScriptRuntime.enumNext(this.objectIterator);
  if (!b.booleanValue()) {
    // Out of values. Throw StopIteration.
    throw new JavaScriptException(
      NativeIterator.getStopIterationObject(scope), null, 0);
  }
  return ScriptRuntime.enumId(this.objectIterator, cx);
}

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

private Object next(Context cx, Scriptable scope) {
  Boolean b = ScriptRuntime.enumNext(this.objectIterator);
  if (!b.booleanValue()) {
    // Out of values. Throw StopIteration.
    throw new JavaScriptException(
      NativeIterator.getStopIterationObject(scope), null, 0);
  }
  return ScriptRuntime.enumId(this.objectIterator, cx);
}

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

private Object next(Context cx, Scriptable scope) {
  Boolean b = ScriptRuntime.enumNext(this.objectIterator);
  if (!b.booleanValue()) {
    // Out of values. Throw StopIteration.
    throw new JavaScriptException(
      NativeIterator.getStopIterationObject(scope), null, 0);
  }
  return ScriptRuntime.enumId(this.objectIterator, cx);
}

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

private Object next(Context cx, Scriptable scope) {
  Boolean b = ScriptRuntime.enumNext(this.objectIterator);
  if (!b.booleanValue()) {
    // Out of values. Throw StopIteration.
    throw new JavaScriptException(
      NativeIterator.getStopIterationObject(scope), null, 0);
  }
  return ScriptRuntime.enumId(this.objectIterator, cx);
}

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

private Object next(Context cx, Scriptable scope) {
  Boolean b = ScriptRuntime.enumNext(this.objectIterator);
  if (!b.booleanValue()) {
    // Out of values. Throw StopIteration.
    throw new JavaScriptException(
      NativeIterator.getStopIterationObject(scope), null, 0);
  }
  return ScriptRuntime.enumId(this.objectIterator, cx);
}

代码示例来源:origin: org.apache.cocoon/cocoon-flowscript-impl

public void jsFunction_processPipelineTo(String uri,
                     Object map,
                     Object outputStream)
throws Exception {
  Object out = unwrap(outputStream);
  if (!(out instanceof OutputStream)) {
    throw new JavaScriptException("expected a java.io.OutputStream instead of " + out);
  }
  getInterpreter().process(getParentScope(), this, uri, map,
               (OutputStream)out);
}

相关文章