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

BigInt offset typings #25

Merged
merged 6 commits into from
May 31, 2023
Merged

Conversation

dkourilov
Copy link
Contributor

The field {offset} returned from OpenFile::fd_seek can be promoted to BigInt. Later on, in WASI::fd_seek the call to buffer.setInt32 fails for BigInt. The proposed patch fixes the problem.

@bjorn3
Copy link
Owner

bjorn3 commented May 31, 2023

Thanks for catching thie! Looks like the returned offset is in both cases unconditionally u64. Could you use setBigInt64 unconditionally in both cases and return only bigint and not number from the respective Fd methods?

src/wasi.ts Outdated Show resolved Hide resolved
@dkourilov
Copy link
Contributor Author

Sorry I couldn't resist changing BigInt in types declarations to bigint interface primitive.

@bjorn3
Copy link
Owner

bjorn3 commented May 31, 2023

I don't really understand the difference between the two, but changing it is fine.

@bjorn3 bjorn3 merged commit ec777d6 into bjorn3:main May 31, 2023
@bjorn3
Copy link
Owner

bjorn3 commented May 31, 2023

Thanks! Published as 0.2.10.

@dkourilov
Copy link
Contributor Author

Thank you!

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.

2 participants