You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Array which is just an object list of heterogeneous types with some additional methods
TypedArray subclasses for numerical values (Int<x>Array, Uint<x>Array, Float<x>Array, BigInt<x>Array and BigUint<x>Array)
It's not easy to translate those to zig native types (eg. slice, tuple) as:
we don't know the shape and the length for Array
we do know the type for TypedArray but not all native types have a corresponding JS typed array, eg. we will have to forbid []bool or []<UserType> as they don't have a TypedArray counterpart
As they are JS native types, Array and TypedArray exists in the JS engine native API (eg. v8.Array), with all their public properties and methods like Length().
So maybe the more logical solution is just to expose those types, ie. define a jsruntime.Array type that will use underneath v8.Array (or quickjs.Array).
The text was updated successfully, but these errors were encountered:
There is 2 types of JS Array:
Array
which is just an object list of heterogeneous types with some additional methodsTypedArray
subclasses for numerical values (Int<x>Array
,Uint<x>Array
,Float<x>Array
,BigInt<x>Array
andBigUint<x>Array
)It's not easy to translate those to zig native types (eg. slice, tuple) as:
Array
TypedArray
but not all native types have a corresponding JS typed array, eg. we will have to forbid[]bool
or[]<UserType>
as they don't have aTypedArray
counterpartAs they are JS native types,
Array
andTypedArray
exists in the JS engine native API (eg. v8.Array), with all their public properties and methods likeLength()
.So maybe the more logical solution is just to expose those types, ie. define a
jsruntime.Array
type that will use underneathv8.Array
(orquickjs.Array
).The text was updated successfully, but these errors were encountered: