cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject svn commit: r635574 - /cocoon/trunk/blocks/cocoon-flowscript/cocoon-flowscript-impl/src/main/java/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java
Date Mon, 10 Mar 2008 14:56:06 GMT
Author: vgritsenko
Date: Mon Mar 10 07:56:01 2008
New Revision: 635574

URL: http://svn.apache.org/viewvc?rev=635574&view=rev
Log:
still need to set optimization level, but for another reason.
See http://markmail.org/message/myogixaqnqmgepjj

Modified:
    cocoon/trunk/blocks/cocoon-flowscript/cocoon-flowscript-impl/src/main/java/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java

Modified: cocoon/trunk/blocks/cocoon-flowscript/cocoon-flowscript-impl/src/main/java/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-flowscript/cocoon-flowscript-impl/src/main/java/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java?rev=635574&r1=635573&r2=635574&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-flowscript/cocoon-flowscript-impl/src/main/java/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java
(original)
+++ cocoon/trunk/blocks/cocoon-flowscript/cocoon-flowscript-impl/src/main/java/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java
Mon Mar 10 07:56:01 2008
@@ -92,6 +92,13 @@
     private static final String USER_GLOBAL_SCOPE = "FOM JavaScript GLOBAL SCOPE/";
 
     /**
+     * Rhino supports Debuggers only in interpreting mode, and we are using
+     * LocationTrackerDebugger. Hence need to force rhino into interpreted
+     * mode by setting optimization level on a context.
+     */
+    private static final int OPTIMIZATION_LEVEL = -1;
+    
+    /**
      * When was the last time we checked for script modifications. Used
      * only if {@link #reloadScripts} is true. Access is synchronized by
      * {@link #compiledScripts}.
@@ -131,6 +138,7 @@
                     db.setVisible(false);
                 }
             });
+            db.setOptimizationLevel(OPTIMIZATION_LEVEL);
             db.setVisible(true);
             debugger = db;
             ContextFactory.getGlobal().addListener(debugger);
@@ -159,6 +167,7 @@
             getDebugger().doBreak();
         }
         Context context = Context.enter();
+        context.setOptimizationLevel(OPTIMIZATION_LEVEL); 
         context.setCompileFunctionsWithDynamicScope(true);
         context.setGeneratingDebug(true);
         // add support for Rhino objects to JXPath
@@ -545,6 +554,7 @@
     public void callFunction(String funName, List params, Redirector redirector)
     throws Exception {
         Context context = Context.enter();
+        context.setOptimizationLevel(OPTIMIZATION_LEVEL); 
         context.setGeneratingDebug(true);
         context.setCompileFunctionsWithDynamicScope(true);
         context.setErrorReporter(new JSErrorReporter());
@@ -641,6 +651,7 @@
         }
 
         Context context = Context.enter();
+        context.setOptimizationLevel(OPTIMIZATION_LEVEL);
         context.setGeneratingDebug(true);
         context.setCompileFunctionsWithDynamicScope(true);
         LocationTrackingDebugger locationTracker = new LocationTrackingDebugger();



Mime
View raw message