2003/11/03 06:32:55
[org.ibex.core.git] / src / org / xwt / Trap.java
index ea2ea95..7d9dcc1 100644 (file)
@@ -16,14 +16,14 @@ public class Trap {
 
     // Static Data //////////////////////////////////////////////////////////////
 
-    private static JS.CompiledFunction cascadeHelper = null;
+    private static Function cascadeHelper = null;
     private static String cascadeHelperText =
         "return function(q) { var ret = arguments.doTrap;" +
         "if (ret != false && !arguments.didCascade) arguments.cascade = q; };";
     static {
         try {
             cascadeHelper = JS.parse("cascadeHelper", 1, new StringReader(cascadeHelperText));
-            cascadeHelper = (JS.CompiledFunction)new JS.Context(cascadeHelper, null, null).resume(null);
+            cascadeHelper = (Function)new JS.Context(cascadeHelper, null).resume();
         } catch (Exception e) {
             Log.log(Trap.class, e);
         }
@@ -52,7 +52,7 @@ public class Trap {
     private Box trapee = null;
 
     /** the function for this trap */
-    JS.CompiledFunction f = null;
+    Function f = null;
 
     /** the next trap down the trap stack */
     private Trap next = null;
@@ -69,7 +69,7 @@ public class Trap {
      *  @param name the name of the property to trap on
      *  @param f the function to place as a trap
      */
-    static void addTrap(Box trapee, Object name, JS.CompiledFunction f) {
+    static void addTrap(Box trapee, Object name, Function f) {
 
         // check if this script has already placed a trap on this property
         for(Trap t = (Trap)trapee.get(name, Trap.class); t != null; t = t.next)
@@ -86,7 +86,7 @@ public class Trap {
      *  @param name the name of the property to trap on
      *  @param f the function to remove
      */
-    static void delTrap(Box trapee, Object name, JS.CompiledFunction f) {
+    static void delTrap(Box trapee, Object name, Function f) {
         Trap t = (Trap)trapee.get(name, Trap.class);
         if (t.f == f) { trapee.put2(name, Trap.class, t.next); return; }
         for(; t.next != null; t = t.next)
@@ -97,7 +97,7 @@ public class Trap {
 
     // Instance Methods //////////////////////////////////////////////////////////////////////////
 
-    private Trap(Box b, String n, JS.CompiledFunction f, Trap nx)
+    private Trap(Box b, String n, Function f, Trap nx)
     { trapee = b; name = n; this.f = f; this.next = nx; }
 
     // Read Traps //////////////////////////////////////////////////////////////////////