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

Wrap OCaml functions before passing them to JavaScript #43

Closed
wants to merge 1 commit into from

Conversation

vouillon
Copy link
Contributor

@vouillon vouillon commented Dec 1, 2022

This is necessary to deal with the calling conventoin mismatch introduced by the upcoming effect support (ocsigen/js_of_ocaml#1340)

This partially addresses #42.

This was done rapidly, so I may have missed a few places.

I'm not sure what to do with Brr.Ev.listen/Brr.Ev.unlisten since removeEventListenerexpects to be invoked with the very same JavaScript function that was passed to addEventListener.

This is necessary to deal with the calling convention mismatch
introduced by the upcoming effect support (ocsigen/js_of_ocaml#1340)
@dbuenzli
Copy link
Owner

dbuenzli commented Dec 5, 2022

Thanks Jérôme. Very much appreciated, saved me quite a bit of time to fix this.

I have merged your patch as b14c3f9. The follow up patch c64b00b tweaks it, hunts a few remaining cases that needed wrapping and updates the FFI cookbook.

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