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

IonReader.bigIntValue() does not always return JSBI values when reading Ion binary #709

Closed
YourFin opened this issue Apr 27, 2022 · 2 comments

Comments

@YourFin
Copy link
Contributor

YourFin commented Apr 27, 2022

In the process of testing my own code, I noticed that IonReader.bigIntValue() was sometimes returning number values, contrary to its contract of only returning JSBI instances or null. Further testing revealed that this only occurred when reading binary data. A minimal failing test case can be found in my fork of this repository here: YourFin@03a85a3

Some spelunking revealed that this is likely a regression introduced by 3554f29, as following the call stack down reveals that .bigIntValue() returns the any-typed _curr value on the underlying ParserBinaryRaw. Prior to 3554f29, when _curr was updated by _readIntegerMagnitude (via IonParserBinaryRaw.bigIntValue -> IonParserBinaryRaw.load_value) it could only be set to JSBI values, but following the commit it could be set to JSBI or number values.

I have what appears to be a fix for this issue committed to my fork of this repository; let me know (slack nuckolp@) if you'd like me to cut that as a pr.

@popematt
Copy link
Contributor

popematt commented May 2, 2022

Hi Patrick, thanks for letting us know about this problem. We would gladly accept a PR to fix it.

@YourFin
Copy link
Contributor Author

YourFin commented May 3, 2022

Closing this issue as the fix was merged

@YourFin YourFin closed this as completed May 3, 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

2 participants