Package org.mozilla.javascript

Examples of org.mozilla.javascript.JavaScriptException


            RhinoInterpreter interp =
                (RhinoInterpreter)window.getInterpreter();
            try {
                interp.evaluate(code);
            } catch (InterpreterException e) {
                throw new JavaScriptException(e);
            }
        }
    }
View Full Code Here


            Script script = interpreter.compileScript(cx, environment, filename);
            return script.exec(cx, scope);
        } catch (JavaScriptException e) {
            throw e;
        } catch (Exception e) {
            throw new JavaScriptException(e);
        }
    }
View Full Code Here

            interpreter.forwardTo(uri, bizData, kont, environment);
        } catch (JavaScriptException e) {
            throw e;
        } catch (Exception e) {
            throw new JavaScriptException(e);
        }
    }
View Full Code Here

            biz = jsobjectToObject(biz);
            return interpreter.process(uri, biz, (OutputStream)out, environment);
        } catch (JavaScriptException e) {
            throw e;
        } catch (Exception e) {
            throw new JavaScriptException(e);
        }
    }
View Full Code Here

        throws JavaScriptException
    {
        try {
            environment.redirect(false,uri);
        } catch (Exception e) {
            throw new JavaScriptException(e);
        }
    }
View Full Code Here

  protected int evalInt(String script) {
    Object o = eval(script);
    if (o instanceof Number) {
      return ((Number) o).intValue();
    }
    throw new JavaScriptException(null, "invalid return type "
        + o.getClass().getName() + " with value " + o, 0);
  }
View Full Code Here

  protected long evalLong(String script) {
    Object o = eval(script);
    if (o instanceof Number) {
      return ((Number) o).longValue();
    }
    throw new JavaScriptException(null, "invalid return type "
        + o.getClass().getName() + " with value " + o, 0);
  }
View Full Code Here

  protected boolean evalBoolean(String script) {
    Object o = eval(script);
    if (o instanceof Boolean) {
      return ((Boolean) o).booleanValue();
    }
    throw new JavaScriptException(null, "invalid return type "
        + o.getClass().getName() + " with value " + o, 0);
  }
View Full Code Here

        Function function = (Function)fObj;
        try {
            return function.call(rhinoContext, rhinoScope, rhinoScope, args);
        } catch (RhinoException angryRhino) {
            if (expectingException != null && angryRhino instanceof JavaScriptException) {
                JavaScriptException jse = (JavaScriptException)angryRhino;
                Assert.assertEquals(jse.getValue(), expectingException);
                return null;
            }
            String trace = angryRhino.getScriptStackTrace();
            Assert.fail("JavaScript error: " + angryRhino.toString() + " " + trace);
        } catch (JavaScriptAssertionFailed assertion) {
View Full Code Here

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

TOP

Related Classes of org.mozilla.javascript.JavaScriptException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.