X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2Fjs%2FJS.java;h=82370a6392f4b029614303c97871ad5501b41435;hb=11fd362678d42aed89e4bc3cd0ce18e399ae48c4;hp=79800fe2ed47cae34ae76666dbf5b9a6341d814a;hpb=f59942ab30a1632789b9d042d233b205245d506b;p=org.ibex.core.git diff --git a/src/org/xwt/js/JS.java b/src/org/xwt/js/JS.java index 79800fe..82370a6 100644 --- a/src/org/xwt/js/JS.java +++ b/src/org/xwt/js/JS.java @@ -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); }