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

Double translation: callback fixes #1819

Merged
merged 3 commits into from
Jan 28, 2025
Merged

Double translation: callback fixes #1819

merged 3 commits into from
Jan 28, 2025

Conversation

vouillon
Copy link
Member

There is a hack in caml_call_gen functions to make Js.wrap_callback work even when the OCaml function is called with more arguments that it expects. This hack was missing in the double translation case.

Also, fix function arity computation for Js.Unsafe.meth_callback and Js.Unsafe.callback.

We should probably run the whole test suite with --enable double-translation, not just the effect tests. (I have run it manually.)

There is a hack in caml_call_gen functions to make Js.wrap_callback work
even when the OCaml function is called with more arguments that it
expects. This hack was missing in the double translation case.
@vouillon
Copy link
Member Author

vouillon commented Jan 28, 2025

Maybe we should deprecate Js.wrap_callback and Js.Unsafe.callback at some point. Js.Unsafe.callback_with_arity is much safer does not require any hack in the runtime.

@vouillon vouillon mentioned this pull request Jan 28, 2025
@hhugo hhugo merged commit 89cad06 into master Jan 28, 2025
31 checks passed
@hhugo hhugo deleted the callback-fix branch January 28, 2025 14:05
@OlivierNicole
Copy link
Contributor

See #1821.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants