Package org.mozilla.javascript

Examples of org.mozilla.javascript.ContextFactory$GlobalSetter


        super(classpathReference);
    }

    public void initializeRhino() {

        rhinoContextFactory = new ContextFactory();
        if (System.getProperty("cxf.jsdebug") != null && !rhinoDebuggerUp) {
            Main.mainEmbedded(rhinoContextFactory, rhinoScope, "Debug embedded JavaScript.");
            rhinoDebuggerUp = true;
        }
View Full Code Here


        super(classpathReference);
    }

    public void initializeRhino() {

        rhinoContextFactory = new ContextFactory();
        if (System.getProperty("cxf.jsdebug") != null && !rhinoDebuggerUp) {
            try {
                Class<?> debuggerMain =
                            ClassLoaderUtils.loadClass("org.mozilla.javascript.tools.debugger.Main",
                                                                   getClass());
View Full Code Here

  private List<String> applyDirectiveInRhino(
      String directiveName, Iterable<String> toEscape, String soyUtilsPath)
      throws Exception {
    List<String> output = Lists.newArrayList();
    Context context = new ContextFactory().enterContext();
    context.setOptimizationLevel(-1)// Only running once.
    ScriptableObject globalScope = context.initStandardObjects();
    globalScope.defineProperty(
        "navigator", Context.javaToJS(new Navigator(), globalScope), ScriptableObject.DONTENUM);
View Full Code Here

            .append(")");
        generatedJsExprsAsJsArrayHasElements = true;
      }
      generatedJsExprsAsJsArray.append("]");

      Context context = new ContextFactory().enterContext();
      context.setOptimizationLevel(-1)// Only running once.
      ScriptableObject globalScope = context.initStandardObjects();
      NativeObject navigator = new NativeObject();
      ScriptableObject.putConstProperty(navigator, "userAgent", "testZilla");
      globalScope.defineProperty("navigator", navigator, ScriptableObject.DONTENUM);
View Full Code Here

        super(classpathReference);
    }

    public void initializeRhino() {

        rhinoContextFactory = new ContextFactory();
        if (System.getProperty("cxf.jsdebug") != null && !rhinoDebuggerUp) {
            try {
                Class<?> debuggerMain =
                            ClassLoaderUtils.loadClass("org.mozilla.javascript.tools.debugger.Main",
                                                                   getClass());
View Full Code Here

    private void dropRootScope() {
       
        // ensure the debugger is closed if the root scope will
        // be replaced to ensure no references to the old scope
        // and context remain
        ContextFactory contextFactory = ContextFactory.getGlobal();
        if (contextFactory instanceof SlingContextFactory) {
            ((SlingContextFactory) contextFactory).exitDebugger();
        }
       
        // drop the scope
View Full Code Here

        setExtensions(ECMA_SCRIPT_EXTENSION, ESP_SCRIPT_EXTENSION);
        setMimeTypes("text/javascript", "application/ecmascript",
            "application/javascript");
        setNames("javascript", ECMA_SCRIPT_EXTENSION, ESP_SCRIPT_EXTENSION);

        ContextFactory contextFactory = ContextFactory.getGlobal();
        if (contextFactory instanceof SlingContextFactory) {
            ((SlingContextFactory) contextFactory).setDebugging(debugging);
        }
    }
View Full Code Here

            initGlobal(new SlingContextFactory(sp));
        }
    }

    public static void teardown() {
        ContextFactory factory = getGlobal();
        if (factory instanceof SlingContextFactory) {
            ((SlingContextFactory) factory).dispose();
        }
    }
View Full Code Here

    private void dispose() {
        // ensure the debugger is closed
        exitDebugger();
       
        // reset the context factory class for future use
        ContextFactory newGlobal = new ContextFactory();
        setField(newGlobal, "hasCustomGlobal", Boolean.FALSE);
        setField(newGlobal, "global", newGlobal);
        setField(newGlobal, "sealed", Boolean.FALSE);
        setField(newGlobal, "listeners", null);
        setField(newGlobal, "disabledListening", Boolean.FALSE);
View Full Code Here

        super(classpathReference);
    }

    public void initializeRhino() {

        rhinoContextFactory = new ContextFactory();
        if (System.getProperty("cxf.jsdebug") != null && !rhinoDebuggerUp) {
            try {
                Class<?> debuggerMain =
                            ClassLoaderUtils.loadClass("org.mozilla.javascript.tools.debugger.Main",
                                                                   getClass());
View Full Code Here

TOP

Related Classes of org.mozilla.javascript.ContextFactory$GlobalSetter

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.