X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2Fjs%2FJS.java;h=2ed9755d0bf33bbd523b1a19724c756cfadd3afc;hb=8235361e8601ae7b36ab707058de3b52225d15a2;hp=ea12dfbe77fadd022a1e8cf8c594d3cd5a1d2885;hpb=a81a151e639664cb340cf3726f9e8b9c77d125fb;p=org.ibex.core.git diff --git a/src/org/xwt/js/JS.java b/src/org/xwt/js/JS.java index ea12dfb..2ed9755 100644 --- a/src/org/xwt/js/JS.java +++ b/src/org/xwt/js/JS.java @@ -51,8 +51,9 @@ public abstract class JS { public static Number toNumber(Object o) { if (o == null) return new Long(0); if (o instanceof Number) return ((Number)o); - // FIXME: There are about 3 pages of rules in ecma262 about string to number conversions - // We aren't even close to following all those rules + + // NOTE: There are about 3 pages of rules in ecma262 about string to number conversions + // We aren't even close to following all those rules. We probably never will be. if (o instanceof String) try { return new Double((String)o); } catch (NumberFormatException e) { return new Double(Double.NaN); } if (o instanceof Boolean) return ((Boolean)o).booleanValue() ? new Long(1) : new Long(0); if (o instanceof JS) return ((JS)o).coerceToNumber();