Examples of compileReader()


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

                    BufferedReader initializerReader = null;
                   
                    try {
                        URL initializer = this.getClass().getClassLoader().getResource("edu/mit/simile/butterfly/Butterfly.js");
                        initializerReader = new BufferedReader(new InputStreamReader(initializer.openStream()));
                        setScript(m, initializer, context.compileReader(initializerReader, "Butterfly.js", 1, null));
                        watch(initializer,m);
                        _logger.trace("Parsed javascript initializer successfully");
                    } finally {
                        if (initializerReader != null) initializerReader.close();
                    }
View Full Code Here

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

                    BufferedReader controllerReader = null;

                    for (URL controllerURL : controllerURLs) {
                        try{
                            controllerReader = new BufferedReader(new InputStreamReader(controllerURL.openStream()));
                            setScript(m, controllerURL, context.compileReader(controllerReader, controllerURL.toString(), 1, null));
                            watch(controllerURL,m);
                            _logger.trace("Parsed javascript controller successfully: {}", controllerURL);
                        } finally {
                            if (controllerReader != null) controllerReader.close();
                        }
View Full Code Here

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

                    ButterflyModule module = this.scripts.get(url);
                    BufferedReader reader = null;
                    try {
                        Context context = Context.enter();
                        reader = new BufferedReader(new InputStreamReader(url.openStream()));
                        Butterfly.setScript(module, url, context.compileReader(reader, url.getFile(), 1, null));
                        _logger.info("{} reloaded", url);
                        Context.exit();
                    } finally {
                        if (reader != null) reader.close();
                    }
View Full Code Here

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

        Context ctx = Context.enter();
        Script script;
        try {
           
            script = ctx.compileReader(
                // To use rhino1.5r4-continuations-R26.jar as a workaround for COCOON-1579: Uncomment the next line.
                // getRootScope(null), //scope
                new StringReader(jsText), // in
                sourceName == null ? "<unknown>" : sourceName, // sourceName
                DomHelper.getLineLocation(element), // lineNo
View Full Code Here

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

        String sourceName = DomHelper.getSystemIdLocation(element);
       
        Context ctx = Context.enter();
        Script script;
        try {
            script = ctx.compileReader(
                getRootScope(), //scope
                new StringReader(jsText), // in
                sourceName == null ? "<unknown>" : sourceName, // sourceName
                DomHelper.getLineLocation(element), // lineNo
                null // securityDomain
View Full Code Here

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

            Script script = scriptCacheMap.get(key);
            if (script == null) {
                Context ctx = Context.enter();
                try {
                    ctx.setOptimizationLevel(-1);
                    script = ctx.compileReader(reader, "", 0, null);
                } catch (Exception e) {
                    Exceptions.printStackTrace(e);
                } finally {
                    Context.exit();
                }
View Full Code Here

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

        Context ctx = Context.enter();
        Script script;
        try {
            // This version of compileReader is deprecated but must be left as is to avoid breaking 2.1
            script = ctx.compileReader(
                getRootScope(), //scope
                new StringReader(jsText), // in
                sourceName == null ? "<unknown>" : sourceName, // sourceName
                DomHelper.getLineLocation(element), // lineNo
                null // securityDomain
View Full Code Here

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

            context.setOptimizationLevel(-1);

            if (getLogger().isDebugEnabled()) {
                getLogger().debug("Compiling script " + file);
            }
            script = context.compileReader(global, new FileReader(file), file.toString(), 1, null);
        } catch (Exception e) {
            compileError = e;
        } finally {
            Context.exit();
        }
View Full Code Here

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

                        Context context = ContextFactory.getGlobal().enterContext();
                        context.setOptimizationLevel(0);
                        context.setLanguageVersion(Context.VERSION_1_6);
                        // -1 for lineno arg prevents Rhino from appending
                        // "(unnamed script#1)" to all error messages
                        context.compileReader(reader, null, -1, null);
                    } finally {
                        Context.exit();
                    }
                } else if ("data".contentEquals(scheme)) {
                    data = true;
View Full Code Here

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

                        Context context = ContextFactory.getGlobal().enterContext();
                        context.setOptimizationLevel(0);
                        context.setLanguageVersion(Context.VERSION_1_6);
                        // -1 for lineno arg prevents Rhino from appending
                        // "(unnamed script#1)" to all error messages
                        context.compileReader(reader, null, -1, null);
                    } finally {
                        Context.exit();
                    }
                } else if ("data".contentEquals(scheme)) {
                    data = true;
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.