Skip to content

Commit 56bffb3

Browse files
committed
Added missing boolean case in Js.cast() polyfill
1 parent 8d05265 commit 56bffb3

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • webfx-platform-teavm-elemental2-polyfill/src/main/java/jsinterop/base

webfx-platform-teavm-elemental2-polyfill/src/main/java/jsinterop/base/Js.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import org.teavm.jso.JSBody;
44
import org.teavm.jso.JSObject;
5+
import org.teavm.jso.core.JSBoolean;
56
import org.teavm.jso.core.JSNumber;
67
import org.teavm.jso.core.JSString;
78

@@ -20,6 +21,8 @@ public static <T> T cast(Object o) {
2021
return (T) JSString.valueOf(s);
2122
if (o instanceof Number n)
2223
return (T) JSNumber.valueOf(n.doubleValue());
24+
if (o instanceof Boolean b)
25+
return (T) JSBoolean.valueOf(b);
2326
return (T) o;
2427
}
2528

0 commit comments

Comments
 (0)