reason-native icon indicating copy to clipboard operation
reason-native copied to clipboard

src/console/nativeChannels.js is incompatible with recent jsoo release.

Open hhugo opened this issue 1 year ago • 3 comments

hhugo avatar Mar 21 '25 08:03 hhugo

How can I reproduce this?

ManasJayanth avatar Mar 21 '25 11:03 ManasJayanth

I don't know. It depends if you've implemented tests that run with js_of_ocaml. I've just noticed the issue while looking at https://github.com/reasonml/reason-native/blob/master/src/console/nativeChannels.js

In the stubs, such as this one, s is an OCaml string.

//Provides: native_log
function native_log(s) {
  joo_global_object.console.log(s.c);
}

in jsoo 5.1.0 (2023-03-07), the memory representation of string was changed. You probably want to use something like

//Provides: native_log
//Requires: caml_jsstring_of_string
function native_log(s) {
-  joo_global_object.console.log(s.c);
+  joo_global_object.console.log(caml_jsstring_of_string(s);
}

hhugo avatar Mar 21 '25 15:03 hhugo

Same apply to other stubs in that file

hhugo avatar Mar 21 '25 15:03 hhugo