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

fix: number to int conversions #474

Merged
merged 5 commits into from
Nov 30, 2022
Merged

fix: number to int conversions #474

merged 5 commits into from
Nov 30, 2022

Conversation

stevenh
Copy link
Collaborator

@stevenh stevenh commented Nov 30, 2022

Fix toInt32, toUint32 conversions which caused test failures on arm64.

Fixes #457

Fix toInt32, toUint32 conversions which caused test failures on arm64.

Fixes #457
@andig
Copy link
Contributor

andig commented Nov 30, 2022

got -v ./... -run Test_issue457
# github.com/robertkrimen/otto
./builtin_string.go:39:20: undefined: toUint16
FAIL	github.com/robertkrimen/otto [build failed]

@stevenh
Copy link
Collaborator Author

stevenh commented Nov 30, 2022

Ooops

Restore toUint16 accidentally removed in clean up.
Fix sign and overflow / underflow cast issues.
Leverage the power of go casts to simplify the conversion from float64
to integer types.
Try using int64 instead of uint64 for uint cases.
@stevenh stevenh marked this pull request as ready for review November 30, 2022 17:21
@stevenh stevenh merged commit 70918b6 into master Nov 30, 2022
@stevenh stevenh deleted the fix/number-to-ints branch November 30, 2022 17:55
@stevenh stevenh mentioned this pull request Nov 30, 2022
sg3des pushed a commit to sg3des/otto that referenced this pull request Jul 17, 2023
Fix toInt32, toUint32 conversions which caused test failures on arm64 by
leveraging the power of go casts to simplify the conversion from float64
to integer types.
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

Successfully merging this pull request may close these issues.

TestBinaryShiftOperation test fails
2 participants