Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSNumber type to support long long type in Web API IDL #194

Open
MaxDesiatov opened this issue May 12, 2022 · 0 comments
Open

JSNumber type to support long long type in Web API IDL #194

MaxDesiatov opened this issue May 12, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@MaxDesiatov
Copy link
Contributor

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?

cc @kateinoigakukun

Originally posted by @MaxDesiatov in swiftwasm/WebAPIKit#42 (comment)

@MaxDesiatov MaxDesiatov added the enhancement New feature or request label May 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant