2003/11/05 10:25:00
[org.ibex.core.git] / src / org / xwt / js / JS.java
index 79800fe..82370a6 100644 (file)
@@ -103,9 +103,19 @@ public abstract class JS {
 
     /** A sensible implementation of the abstract methods in the JS class */
     public static class Obj extends JS {
+
+        // FIXME: move these to an interface so they're optional
         // this gets around a wierd fluke in the Java type checking rules for ?..:
         public static final Object T = Boolean.TRUE;
         public static final Object F = Boolean.FALSE;
+
+        // FIXME: be smart here; perhaps intern
+        public static final Number N(int i) { return new Integer(i); }
+        public static final Number N(long l) { return new Long(l); }
+        public static final Number N(double d) { return new Double(d); }
+
+        public static final Boolean B(boolean b) { return b ? Boolean.TRUE : Boolean.FALSE; }
+
         private Hash entries = null;
         private boolean sealed = false;
         public Obj() { this(false); }