2003/04/30 04:39:41
[org.ibex.core.git] / src / org / xwt / Trap.java
index 94624ae..aee4625 100644 (file)
@@ -75,7 +75,7 @@ public class Trap {
     static void addTrap(Box trapee, String name, Function f, boolean isreadtrap, Scriptable rp) {
 
         if (PROHIBITED.get(name) != null || name.startsWith("xwt_")) {
-            System.out.println("Error: you cannot place traps on special property \"" + name + "\"");
+            Log.log(Trap.class, "Error: you cannot place traps on special property \"" + name + "\"");
             return;
         }
 
@@ -148,6 +148,13 @@ public class Trap {
         else return current.trapee;
     }
 
+    /** called by Rhino's arguments.trapname hack */
+    public static String currentTrapname() {
+        Trap current = TrapContext.get().currentTrap;
+        if (current == null) return null;
+        else return current.name;
+    }
+
     /** removes all traps whose function's ultimate parent scope is <tt>b</tt>. Used for retheming */
     public static void removeAllTrapsByBox(Box b) {
         Enumeration e = allTraps.keys();