Open
Description
Rust folks have a similar issue, where long long
shouldn't be mapped to Int64
, which is bridged to BigInt
on JS side. rustwasm/wasm-bindgen#800
Checked a few other places where long long
is used, like AudioData
, Blob
, and File
and all of them return a JS number in corresponding properties, not BigInt
. I'm 95% sure none of these support BigInt
, remaining 5% certainty could be added by writing actual tests. I personally vote for either keeping these Int32
as proposed, or creating a new union type. Just riffing:
enum JSNumber: ExpressibleByIntegerLiteral, ExpressibleByFloatLiteral {
case integer(Int32)
case float(Double)
// ...
}
Should we add such type to JSKit then?
Originally posted by @MaxDesiatov in swiftwasm/WebAPIKit#42 (comment)