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

Compatibility with Wasm_of_ocaml #173

Merged
merged 2 commits into from
Sep 29, 2023
Merged

Compatibility with Wasm_of_ocaml #173

merged 2 commits into from
Sep 29, 2023

Conversation

vouillon
Copy link
Contributor

@vouillon vouillon commented Jul 25, 2023

Wasm_of_ocaml uses a different representation for OCaml floats and JavaScript numbers, so we need explicit coercions (which are still optimized away by Js_of_ocaml).

Also, since JavaScript values get boxed, physical equality can no longer be used to test whether a value is undefined.
But as undefined == null, I have just simplified the test in option_of_js.

The WebAssembly implementation of the runtime functions caml_ojs_wrap_fun_arguments and caml_ojs_iterate_properties is provided by wasm_of_ocaml.

In JavaScript, 'x === undefined' implies 'x == null'.
@mlasson
Copy link
Member

mlasson commented Sep 29, 2023

Thanks for the PR ! wasm_of_ocaml looks super cool !

@mlasson mlasson merged commit 5175a31 into LexiFi:master Sep 29, 2023
6 checks passed
@OlivierNicole
Copy link

Hello, do you intend to make a new release with these changes? Js_of_ocaml will probably release a breaking change regarding float conversions soon-ish.

@OlivierNicole
Copy link

I see that it’s done, that was fast! Thanks a lot!

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.

3 participants