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;
}
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();