2003/11/13 09:15:12
[org.ibex.core.git] / src / org / xwt / js / JSContext.java
index 4e2d0b0..625c834 100644 (file)
@@ -23,12 +23,12 @@ public class JSContext {
      *  eval()
      */
     int pausecount = 0;
+    boolean pauseable;
 
-    JSFunction f = null;          ///< the currently-executing JSFunction
-    JSScope scope = null;
+    JSFunction f;                 ///< the currently-executing JSFunction
+    JSScope scope;
     Vec stack = new Vec();        ///< the object stack
     int pc = 0;                   ///< the program counter
-    boolean pauseable;
 
     public static void invokePauseable(JSFunction function) { new JSContext(function, true).invoke(new JSArray()); }
 
@@ -39,7 +39,10 @@ public class JSContext {
     }
 
     void invoke(JSArray args) {
+        JSFunction tf = f;
+        f = null;
         stack.push(new JSFunction.CallMarker(this));
+        f = tf;
         stack.push(args);
         resume();
     }