Package dev.gmitch215.bytebox.js
Class JSArrays
java.lang.Object
dev.gmitch215.bytebox.js.JSArrays
Builds a JavaScript array from a Java one.
JSArray.of is the interop's own version of this and it does not survive being reached
from a new place: its body is generic, the compiler specialises it per call site, and past some
number of specialisations it emits local.set expected type externref, found array.get and
the module no longer compiles. The failure lands in whichever method called it, which is a long way
from the cause.
Nothing here is generic at the boundary. The two scripts take and return JSObject, so
there is one shape to compile however many element types call through.
- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends org.teavm.jso.JSObject>
org.teavm.jso.core.JSArray<T> of(T[] items) A JavaScript array holding the same values, in the same order.
-
Method Details
-
of
public static <T extends org.teavm.jso.JSObject> org.teavm.jso.core.JSArray<T> of(T[] items) A JavaScript array holding the same values, in the same order.- Type Parameters:
T- the element type- Parameters:
items- the values- Returns:
- the array
-