2004/01/07 20:37:33
[org.ibex.core.git] / src / org / xwt / js / JS.java
index c6d5dd6..a4b1650 100644 (file)
@@ -14,6 +14,10 @@ public class JS extends org.xwt.util.BalancedTree {
     /** log a message with the current JavaScript sourceName/line */
     public static void log(Object o, Object message) { log(message); }
     public static void log(Object message) { Log.echo(JS.getSourceName() + ":" + JS.getLine(), message); }
+    public static void log(JSExn e) {
+        Log.echo(e,"JS Exception: " + e.getObject() + "\n" + e.backtrace());
+        Log.echo(e,e);
+    }
 
     public static int getLine() {
         Interpreter c = Interpreter.current();
@@ -156,7 +160,7 @@ public class JS extends org.xwt.util.BalancedTree {
     /** override and return true to allow placing traps on this object.
         *  if isRead true, this is a read trap, otherwise write trap
         **/
-    protected boolean isTrappable(Object name, boolean isRead) { return false; }
+    protected boolean isTrappable(Object name, boolean isRead) { return true; }
 
     /** performs a put, triggering traps if present; traps are run in an unpauseable interpreter */
     public void putAndTriggerTraps(Object key, Object value) throws JSExn {