X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2Fjs%2FJS.java;fp=src%2Forg%2Fxwt%2Fjs%2FJS.java;h=0336e2712cfc14f77136e5181d606608ee5cc346;hb=772b947b9b23de711953d0a1e33cef5f356c442a;hp=a4b16509dc892f80ad86752c7577328271db3d0d;hpb=434205ebc29c9da561a6c1cd4f869cc6d2b9bec4;p=org.ibex.core.git diff --git a/src/org/xwt/js/JS.java b/src/org/xwt/js/JS.java index a4b1650..0336e27 100644 --- a/src/org/xwt/js/JS.java +++ b/src/org/xwt/js/JS.java @@ -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"; }