-
Notifications
You must be signed in to change notification settings - Fork 8
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
Map GLintptr
IDL type to Swift Int32
#42
Conversation
This fixes an issue with `func vertexAttribPointer(index: GLuint, size: GLint, type: GLenum, normalized: GLboolean, stride: GLsizei, offset: GLintptr)` passing `offset` value of `BigInt` type to the JS function due to `public typealias GLintptr = Int64`, which led to `can't cast BigInt to number` runtime errors. Either WebGL spec is wrong, or browsers implement it incorrectly. Rust folks had a similar issue and they went with `i32`.
If this is the only type that doesn’t accept a |
As you can see, there are a few more places from other modules that utilize |
Not as far as I can tell. But such a thing could definitely be added! You’d just need to pre-define an appropriate |
Checked a few other places where enum JSNumber: ExpressibleByIntegerLiteral, ExpressibleByFloatLiteral {
case integer(Int32)
case float(Double)
// ...
} Should we add such type to JSKit then? |
long long
IDL type to Swift Int32
GLintptr
IDL type to Swift Int32
I think it should be a protocol that both |
Existentials have a substantial overhead, especially too large to be acceptable for primitive types like numbers. Either way, |
This fixes an issue with
passing
offset
value ofBigInt
type to the JS function due topublic typealias GLintptr = Int64
, which led tocan't cast BigInt to number
runtime errors.Either WebGL spec is wrong, or browsers implement it incorrectly. Rust folks had a similar issue and they went with
i32
, see rustwasm/wasm-bindgen#800.