Package org.mozilla.javascript

Examples of org.mozilla.javascript.Context.evaluateReader()


            replacedProperties = setBoundProperties(scope, bindings);

            final int lineNumber = 1;
            final Object securityDomain = null;

            Object result = rhinoContext.evaluateReader(scope, scriptReader, scriptName,
                    lineNumber, securityDomain);

            if (result instanceof Wrapper) {
                result = ((Wrapper) result).unwrap();
            }
View Full Code Here


        Object rv = null;
        final Context ctx = enterContext();

        try {
          rv = ctx.evaluateReader(globalObject,
                                  scriptreader,
                                  description,
                                  1, rhinoClassLoader);
        } catch (JavaScriptException e) {
            // exception from JavaScript (possibly wrapping a Java Ex)
View Full Code Here

        Object rv = null;
        Context ctx = enterContext();

        ctx.setWrapHandler(wrapHandler);
        try {
            rv = ctx.evaluateReader(globalObject,
                                    scriptreader,
                                    SOURCE_NAME_SVG,
                                    1, rhinoClassLoader);
        } catch (JavaScriptException e) {
            // exception from JavaScript (possibly wrapping a Java Ex)
View Full Code Here

            }

            final int lineNumber = 1;
            final Object securityDomain = null;

            return rhinoContext.evaluateReader(scope, scriptReader, scriptName,
                lineNumber, securityDomain);

        } catch (JavaScriptException t) {
           
            final ScriptException se = new ScriptException(t.details(),
View Full Code Here

                try {
                    Context context = Context.enter();
                    context.setOptimizationLevel(-1); // Without this, Rhino hits a 64K bytecode limit and fails
                    try {
                        globalScope = context.initStandardObjects();
                        context.evaluateReader(globalScope, reader, "coffee-script.js", 0, null);
                    } finally {
                        Context.exit();
                    }
                } finally {
                    reader.close();
View Full Code Here

        throws InterpreterException, IOException {
        Object rv = null;
        Context ctx = Context.enter();
        ctx.setWrapHandler(wrapHandler);
        try {
            rv = ctx.evaluateReader(globalObject,
                                    scriptreader,
                                    "<SVG>",
                                    1, null);
        } catch (JavaScriptException e) {
            // exception from JavaScript (possibly wrapping a Java Ex)
View Full Code Here

      thrScope = enterContext(environment, null);
      source = environment.resolve(sourceName);
      InputStream inputStream = source.getInputStream();
      Reader reader = new BufferedReader(new InputStreamReader(inputStream));
      Context ctx = Context.getCurrentContext();
      ctx.evaluateReader(scope, reader, sourceName, 1, null);
    }
    catch (Exception ex) {
      ex.printStackTrace();
      throw ex;
    }
View Full Code Here

        Object rv = null;
        Context ctx = enterContext();

        ctx.setWrapHandler(wrapHandler);
        try {
            rv = ctx.evaluateReader(globalObject,
                                    scriptreader,
                                    "<SVG>",
                                    1, rhinoClassLoader);
        } catch (JavaScriptException e) {
            // exception from JavaScript (possibly wrapping a Java Ex)
View Full Code Here

                Reader reader = new InputStreamReader(inputStream, "UTF-8");
                try {
                    Context context = Context.enter();
                    context.setOptimizationLevel(-1); // Without this, Rhino hits a 64K bytecode limit and fails
                    try {
                        context.evaluateReader(globalScope, reader, filename, 0, null);
                    } finally {
                        Context.exit();
                    }
                } finally {
                    reader.close();
View Full Code Here

    }

    try
    {
      ScriptableObject.defineProperty(scope, "params", wrappedParams, 0);
      cx.evaluateReader(scope, new FileReader(source), this.source, 1, null);
    }
    catch (IOException ex)
    {
      logger.error("Failed to read " + source + ": " + ex.toString());
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.