@Test public void testToString01() { assertEquals("null", ToString(null)); assertEquals("false", ToString(false)); assertEquals("true", ToString(true)); assertEquals("abc", ToString("abc")); assertEquals("0", ToString(0)); assertEquals("NaN", ToString(NaN)); }
static String ToString(Object arg) { if (arg == null) { return "null"; } else if (Boolean.TRUE.equals(arg)) { return "true"; } else if (Boolean.FALSE.equals(arg)) { return "false"; } else if (arg instanceof String) { return (String) arg; } else if (arg instanceof Number) { return ToString((Number) arg); } Object primValue = ToPrimitive(arg, "String"); return ToString(primValue); }
JSAbstractOperations { static String ToString(Object arg) { if (arg == null) { return "null"; } else if (Boolean.TRUE.equals(arg)) { return "true"; } else if (Boolean.FALSE.equals(arg)) { return "false"; } else if (arg instanceof String) { return (String) arg; } else if (arg instanceof Number) { return ToString((Number) arg); } Object primValue = ToPrimitive(arg, "String"); return ToString(primValue); } }
JSAbstractOperations { static String ToString(Object arg) { if (arg == null) { return "null"; } else if (Boolean.TRUE.equals(arg)) { return "true"; } else if (Boolean.FALSE.equals(arg)) { return "false"; } else if (arg instanceof String) { return (String) arg; } else if (arg instanceof Number) { return ToString((Number) arg); } Object primValue = ToPrimitive(arg, "String"); return ToString(primValue); }  }
JSAbstractOperations { static String ToString(Object arg) { if (arg == null) { return "null"; } else if (Boolean.TRUE.equals(arg)) { return "true"; } else if (Boolean.FALSE.equals(arg)) { return "false"; } else if (arg instanceof String) { return (String) arg; } else if (arg instanceof Number) { return ToString((Number) arg); } Object primValue = ToPrimitive(arg, "String"); return ToString(primValue); }   }
JSAbstractOperations { static String ToString(Object arg) { if (arg == null) { return "null"; } else if (Boolean.TRUE.equals(arg)) { return "true"; } else if (Boolean.FALSE.equals(arg)) { return "false"; } else if (arg instanceof String) { return (String) arg; } else if (arg instanceof Number) { return ToString((Number) arg); } Object primValue = ToPrimitive(arg, "String"); return ToString(primValue); }   static final BigInteger UINT_MAX_VALUE; static final Double UINT_MAX_VALUE_D; static final BigInteger SINT_MAX_VALUE; static final BigInteger USHORT_MAX_VALUE; }