Package org.mozilla.javascript

Examples of org.mozilla.javascript.EvaluatorException


      HTMLUtil.addMarker(file, IMarker.SEVERITY_ERROR, line, message);
    }

    public EvaluatorException runtimeError(String message, String sourceName, int line, String lineSource, int lineOffset) {
      //addMarker(IMarker.SEVERITY_ERROR, line, message);
      return new EvaluatorException(message, sourceName, line, lineSource, lineOffset);
    }
View Full Code Here


        } else if (obj instanceof Map) {
            this.javaObject = this.list = new ArrayList<Object>(((Map<?,?>)obj).values());
        } else if (obj == null || obj == Undefined.instance) {
            this.javaObject = this.list = new ArrayList<Object>();
        } else {
            throw new EvaluatorException("Invalid argument to ScriptableList(): " + obj);
        }
        this.staticType = this.list.getClass();
        initMembers();
        initPrototype(scope);
    }
View Full Code Here

        BaseFunction ctor = new BaseFunction(scope, ScriptableObject.getFunctionPrototype(scope)) {
            @Override
            public Scriptable construct(Context cx, Scriptable scope, Object[] args) {
                boolean reflect = false;
                if (args.length > 2) {
                    throw new EvaluatorException("ScriptableMap() called with too many arguments");
                } if (args.length == 2) {
                    reflect = ScriptRuntime.toBoolean(args[1]);
                }
                return new ScriptableMap(scope, args.length == 0 ? null : args[0], reflect);
            }
View Full Code Here

                } else if (id instanceof Number) {
                    this.map.put(id, s.get(((Number)id).intValue(), s));
                }
            }
        } else {
            throw new EvaluatorException("Invalid argument to ScriptableMap(): " + obj);
        }
        this.javaObject = this.map;
        this.staticType = this.map.getClass();
        initMembers();
        initPrototype(scope);
View Full Code Here

            @Override
            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

              System.err.println("\n[ERROR] " + message);
            }
            public EvaluatorException runtimeError(String message, String sourceName,
                    int line, String lineSource, int lineOffset) {
                error(message, sourceName, line, lineSource, lineOffset);
                return new EvaluatorException(message);
            }
        };
       
        // check and process each file that might need compression
        for (File f : outputFiles) {
View Full Code Here

        abstract void close();
        abstract Object spawn(Context cx, List<String> execArgs, Scriptable options);

        protected void send(Context cx, Object message)
        {
            throw new EvaluatorException("IPC is not enabled to the child");
        }
View Full Code Here

        }

        protected Scriptable getStdioObj(Scriptable stdio, int arg)
        {
            if (!stdio.has(arg, stdio)) {
                throw new EvaluatorException("Missing configuration for fd " + arg);
            }
            return (Scriptable)stdio.get(arg, stdio);
        }
View Full Code Here

        }

        protected String getStdioType(Scriptable s)
        {
            if (!s.has("type", s)) {
                throw new EvaluatorException("Missing type in stdio");
            }
            return Context.toString(s.get("type", s));
        }
View Full Code Here

        }

        protected int getStdioFD(Scriptable s)
        {
            if (!s.has("fd", s)) {
                throw new EvaluatorException("Missing fd in fd type stdio object");
            }
            return (Integer)Context.jsToJava(s.get("fd", s), Integer.class);
        }
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.