Skip to content

Commit

Permalink
Add Byte to list of java Numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
tonygermano authored and gbrail committed Jul 21, 2024
1 parent 46fa711 commit dc08eb5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public Object wrap(Context cx, Scriptable scope, Object obj, Class<?> staticType
if (obj instanceof String
|| obj instanceof Boolean
|| obj instanceof Integer
|| obj instanceof Byte
|| obj instanceof Short
|| obj instanceof Long
|| obj instanceof Float
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public void primitiveWrapTrue() {
test(true, Boolean.FALSE, "boolean", "object", "object");
test(true, Integer.valueOf(1), "number", "object", "object");
test(true, Long.valueOf(2L), "number", "object", "object");
test(true, Byte.valueOf((byte) 5), "number", "object", "object");
test(true, new BigInteger("3"), "bigint", "object", "object");
test(true, new BigDecimal("4.0"), "number", "object", "object");
}
Expand All @@ -34,6 +35,7 @@ public void primitiveWrapFalse() {
test(false, Boolean.FALSE, "boolean", "boolean", "boolean");
test(false, Integer.valueOf(1), "number", "number", "number");
test(false, Long.valueOf(2L), "number", "number", "number");
test(false, Byte.valueOf((byte) 5), "number", "number", "number");

test(false, new BigInteger("30"), "bigint", "bigint", "bigint");

Expand Down

0 comments on commit dc08eb5

Please sign in to comment.