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

invalid type: floating point 4294967295, expected u32 #98

Closed
lastmjs opened this issue Mar 21, 2022 · 6 comments
Closed

invalid type: floating point 4294967295, expected u32 #98

lastmjs opened this issue Mar 21, 2022 · 6 comments

Comments

@lastmjs
Copy link
Member

lastmjs commented Mar 21, 2022

The primitive_types example getNat32 function is breaking...the parsing seems to have a problem with the u32::MAX value coming from JavaScript.

@lastmjs
Copy link
Member Author

lastmjs commented Mar 21, 2022

Make a minimum reproducible example for boa, hopefully they can fix it

@lastmjs
Copy link
Member Author

lastmjs commented Mar 21, 2022

It's happening with other numbers as well:

[Canister rrkah-fqaaa-aaaaa-aaaaq-cai] Panicked at 'called `Result::unwrap()` on an `Err` value: Error("invalid type: floating point `999500`, expected u32", line: 0, column: 0)', src/src/lib.rs:171:177
[Canister rrkah-fqaaa-aaaaa-aaaaq-cai] Panicked at 'called `Result::unwrap()` on an `Err` value: Error("invalid type: floating point `500`, expected u32", line: 0, column: 0)', src/src/lib.rs:171:177

@lastmjs
Copy link
Member Author

lastmjs commented Mar 21, 2022

This is breaking on i32 as well...

@lastmjs
Copy link
Member Author

lastmjs commented Mar 21, 2022

@lastmjs
Copy link
Member Author

lastmjs commented Mar 22, 2022

Should be fixed when this is done: boa-dev/boa#1961 (comment)

@lastmjs
Copy link
Member Author

lastmjs commented Mar 31, 2022

This is fixed with the new traits IntoJsValue and TryFromJsValue.

@lastmjs lastmjs closed this as completed Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant