Package org.mozilla.javascript

Examples of org.mozilla.javascript.EvaluatorException


      }

      public EvaluatorException runtimeError(String message, String sourceName,
          int line, String lineSource, int lineOffset) {
        error(message, sourceName, line, lineSource, lineOffset);
        return new EvaluatorException(message);
      }
    };
  }
View Full Code Here


  {
      String errMsg = getErrorMessage("msg.error", message,
                                      sourceName, line,
                                      lineSrc, column);
      System.err.println(errMsg);
      return new EvaluatorException(errMsg);
  }
View Full Code Here

                    throw new ResourceNotFoundException("Function \"javascript:"+funName+ "()\" not found");
                }
                ScriptRuntime.call(context, fun, thrScope,
                                   funArgs, thrScope);
            } catch (JavaScriptException ex) {
                EvaluatorException ee =
                    Context.reportRuntimeError(ToolErrorReporter.getMessage("msg.uncaughtJSException",
                                                                            ex.getMessage()));
                Throwable unwrapped = unwrap(ex);
                if (unwrapped instanceof ProcessingException) {
                    throw (ProcessingException)unwrapped;
                }
               
                throw new CascadingRuntimeException(ee.getMessage(), unwrapped);
            } catch (EcmaError ee) {
                String msg = ToolErrorReporter.getMessage("msg.uncaughtJSException", ee.toString());
                if (ee.getSourceName() != null) {
                    Context.reportRuntimeError(msg,
                                               ee.getSourceName(),
                                               ee.getLineNumber(),
                                               ee.getLineSource(),
                                               ee.getColumnNumber());
                } else {
                    Context.reportRuntimeError(msg);
                }
                throw new CascadingRuntimeException(ee.getMessage(), ee);
            } finally {
                updateSession(thrScope);
                if (cocoon != null) cocoon.invalidate();
                Context.exit();
            }
View Full Code Here

            try {
                ScriptableObject.callMethod(cocoon,
                                            "handleContinuation",
                                            args);
            } catch (JavaScriptException ex) {
                EvaluatorException ee =
                    Context.reportRuntimeError(ToolErrorReporter.getMessage("msg.uncaughtJSException",
                                                                            ex.getMessage()));
                Throwable unwrapped = unwrap(ex);
                if (unwrapped instanceof ProcessingException) {
                    throw (ProcessingException)unwrapped;
                }
               
                throw new CascadingRuntimeException(ee.getMessage(), unwrapped);
            } catch (EcmaError ee) {
                String msg = ToolErrorReporter.getMessage("msg.uncaughtJSException", ee.toString());
                if (ee.getSourceName() != null) {
                    Context.reportRuntimeError(msg,
                                               ee.getSourceName(),
                                               ee.getLineNumber(),
                                               ee.getLineSource(),
                                               ee.getColumnNumber());
                } else {
                    Context.reportRuntimeError(msg);
                }
                throw new CascadingRuntimeException(ee.getMessage(), ee);
            } finally {
                updateSession(kScope);
                cocoon.invalidate();
                Context.exit();
            }
View Full Code Here

                    if (fun == Scriptable.NOT_FOUND) {
                        throw new ResourceNotFoundException("Function \"javascript:" + funName + "()\" not found");
                    }
                    ScriptRuntime.call(context, fun, thrScope, funArgs, thrScope);
                } catch (JavaScriptException ex) {
                    EvaluatorException ee = Context.reportRuntimeError(
                                                                       ToolErrorReporter.getMessage("msg.uncaughtJSException",
                                                                                                    ex.getMessage()));
                    Throwable unwrapped = unwrap(ex);
                    if (unwrapped instanceof ProcessingException) {
                        throw (ProcessingException)unwrapped;
                    }
                    throw new CascadingRuntimeException(ee.getMessage(),
                                                        unwrapped);
                } catch (EcmaError ee) {
                    String msg = ToolErrorReporter.getMessage("msg.uncaughtJSException", ee.toString());
                    if (ee.getSourceName() != null) {
                        Context.reportRuntimeError(msg, ee.getSourceName(),
                                                   ee.getLineNumber(), ee.getLineSource(),
                                                   ee.getColumnNumber());
                    } else {
                        Context.reportRuntimeError(msg);
                    }
                    throw new CascadingRuntimeException(ee.getMessage(), ee);
                }
            } finally {
                updateSession(thrScope);
                if (cocoon != null) {
                    cocoon.popCallContext();
View Full Code Here

                Object[] args = new Object[] {k, fom_wk};
                try {
                    ScriptableObject.callMethod(cocoon,
                                                "handleContinuation", args);
                } catch (JavaScriptException ex) {
                    EvaluatorException ee = Context.reportRuntimeError(
                                                                       ToolErrorReporter.getMessage("msg.uncaughtJSException",
                                                                                                    ex.getMessage()));
                    Throwable unwrapped = unwrap(ex);
                    if (unwrapped instanceof ProcessingException) {
                        throw (ProcessingException)unwrapped;
                    }
                    throw new CascadingRuntimeException(ee.getMessage(),
                                                        unwrapped);
                } catch (EcmaError ee) {
                    String msg = ToolErrorReporter.getMessage("msg.uncaughtJSException", ee.toString());
                    if (ee.getSourceName() != null) {
                        Context.reportRuntimeError(msg, ee.getSourceName(),
                                                   ee.getLineNumber(), ee.getLineSource(),
                                                   ee.getColumnNumber());
                    } else {
                        Context.reportRuntimeError(msg);
                    }
                    throw new CascadingRuntimeException(ee.getMessage(), ee);
                }
            } finally {
                updateSession(kScope);
                if (cocoon != null) {
                    cocoon.popCallContext();
View Full Code Here

                                      sourceName, line,
                                      lineSrc, column);
      appendMessage(errMsg, sourceName, line, column);
      System.err.println(errMsg);
      // FIXME(SW): need to build a locatable extension to EvaluatorException
      return new EvaluatorException(this.message.toString());
  }
View Full Code Here

            Object fun = global.get(method, global);
            // NOTE: Source and line arguments are nonsense in a call().
            //       Any way to make these arguments *sensible?
            if (fun == Scriptable.NOT_FOUND)
                throw new EvaluatorException("function " + method +
                                             " not found.", "none", 0);

            cx.setOptimizationLevel(-1);
            cx.setGeneratingDebug(false);
            cx.setGeneratingSource(false);
View Full Code Here

                    throw new ResourceNotFoundException(
                            "Function \"javascript:" + funName + "()\" not found");
                }
                ScriptRuntime.call(context, fun, thrScope, funArgs, thrScope);
            } catch (JavaScriptException ex) {
                EvaluatorException ee = Context.reportRuntimeError(
                        ToolErrorReporter.getMessage("msg.uncaughtJSException",
                                ex.getMessage()));
                Throwable unwrapped = unwrap(ex);
                if (unwrapped instanceof ProcessingException) {
                    throw (ProcessingException)unwrapped;
                }
                throw new CascadingRuntimeException(ee.getMessage(),
                        unwrapped);
            } catch (EcmaError ee) {
                String msg = ToolErrorReporter.getMessage(
                        "msg.uncaughtJSException", ee.toString());
                if (ee.getSourceName() != null) {
                    Context.reportRuntimeError(msg, ee.getSourceName(),
                           ee.getLineNumber(), ee.getLineSource(),
                           ee.getColumnNumber());
                } else {
                    Context.reportRuntimeError(msg);
                }
                throw new CascadingRuntimeException(ee.getMessage(), ee);
            } finally {
                updateSession(environment, thrScope);
                if (cocoon != null) {
                    cocoon.popCallContext();
                }
View Full Code Here

            Object[] args = new Object[] {k, fom_wk};
            try {
                ScriptableObject.callMethod(cocoon,
                        "handleContinuation", args);
            } catch (JavaScriptException ex) {
                EvaluatorException ee = Context.reportRuntimeError(
                        ToolErrorReporter.getMessage("msg.uncaughtJSException",
                                ex.getMessage()));
                Throwable unwrapped = unwrap(ex);
                if (unwrapped instanceof ProcessingException) {
                    throw (ProcessingException)unwrapped;
                }
                throw new CascadingRuntimeException(ee.getMessage(),
                        unwrapped);
            } catch (EcmaError ee) {
                String msg = ToolErrorReporter.getMessage(
                        "msg.uncaughtJSException", ee.toString());
                if (ee.getSourceName() != null) {
                    Context.reportRuntimeError(msg, ee.getSourceName(),
                               ee.getLineNumber(), ee.getLineSource(),
                               ee.getColumnNumber());
                } else {
                    Context.reportRuntimeError(msg);
                }
                throw new CascadingRuntimeException(ee.getMessage(), ee);
            } finally {
                updateSession(environment, kScope);
                cocoon.popCallContext();
                Context.exit();
            }
View Full Code Here

TOP

Related Classes of org.mozilla.javascript.EvaluatorException

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.