ugly hack to fix problem with Immutable.getTrap()
[org.ibex.js.git] / src / org / ibex / js / JS.java
index a727048..2c0baee 100644 (file)
@@ -109,12 +109,14 @@ public interface JS extends Pausable {
         public JS getAndTriggerTraps(JS key) throws JSExn { return null; } // FIXME throw errors?
         public JS justTriggerTraps(JS key, JS value) throws JSExn { return null; }
 
-        public void addTrap(JS key, JS function) throws JSExn { throw new JSExn(
-            "'" + key + "' is not trappable on class ["+ getClass().getName() +"]"); }
-        public void delTrap(JS key, JS function) throws JSExn { throw new JSExn(
-            "'" + key + "' trap is read only on class ["+ getClass().getName() +"]"); }
-        public Trap getTrap(JS key) throws JSExn { throw new JSExn(
-            "'" + key + "' is not trappable on class ["+ getClass().getName() +"]"); }
+        public void addTrap(JS key, JS function) throws JSExn {
+            Log.warn(this, "'" + JSU.str(key) + "' is not trappable on class ["+ getClass().getName() +"]"); }
+        public void delTrap(JS key, JS function) throws JSExn {
+            Log.warn(this, "'" + JSU.str(key) + "' trap is read only on class ["+ getClass().getName() +"]"); }
+        public Trap getTrap(JS key) throws JSExn {
+            //Log.warn(this, "'" + JSU.str(key) + "' is not trappable on class ["+ getClass().getName() +"]");
+            return null;
+        }
 
         public String coerceToString() { return "object"; }
     }