2004/01/08 05:32:44
[org.ibex.core.git] / src / org / xwt / js / JS.java
index a4b1650..0336e27 100644 (file)
@@ -219,9 +219,12 @@ public class JS extends org.xwt.util.BalancedTree {
 
     // Typing Support //////////////////////////////////////////////////////////////////////////////
 
-    public Number coerceToNumber() { throw new JSRuntimeExn("tried to coerce a JavaScript object to a Number"); }
-    public String coerceToString() { throw new JSRuntimeExn("tried to coerce a JavaScript object to a String"); }
-    public boolean coerceToBoolean() { throw new JSRuntimeExn("tried to coerce a JavaScript object to a Boolean"); }
+    public Number coerceToNumber() { throw new JSRuntimeExn("tried to coerce a JavaScript object of type " + 
+                                                            getClass().getName() + " to a Number"); }
+    public String coerceToString() { throw new JSRuntimeExn("tried to coerce a JavaScript object of type " +
+                                                            getClass().getName() + " to a String"); }
+    public boolean coerceToBoolean() { throw new JSRuntimeExn("tried to coerce a JavaScript object of type " +
+                                                            getClass().getName() + " to a Boolean"); }
 
     public String typeName() { return "object"; }