diff --git a/compiler/num-testsuite/test.ml b/compiler/num-testsuite/test.ml index 89bae70cf6..8b05039648 100644 --- a/compiler/num-testsuite/test.ml +++ b/compiler/num-testsuite/test.ml @@ -5,7 +5,7 @@ let flush_all () = flush stdout; flush stderr;; let message s = print_string s; print_newline ();; let error_occurred = ref false;; -let immediate_failure = ref false;; +let immediate_failure = ref true;; let error () = if !immediate_failure then exit 2 else begin diff --git a/runtime/dynlink.js b/runtime/dynlink.js index b714a4495d..2fda72ef42 100644 --- a/runtime/dynlink.js +++ b/runtime/dynlink.js @@ -22,7 +22,7 @@ var current_libs = [0, joo_global_object] //Provides: caml_dynlink_open_lib //Requires: current_libs, caml_failwith function caml_dynlink_open_lib (_mode,file) { - var name = file; + var name = file.toString(); joo_global_object.console.log("Dynlink: try to open ", name); //caml_failwith("file not found: "+name) current_libs.push({}); @@ -39,7 +39,7 @@ function caml_dynlink_close_lib (idx) { //Provides: caml_dynlink_lookup_symbol //Requires: current_libs function caml_dynlink_lookup_symbol (idx, fun_name) { - var name = fun_name; + var name = fun_name.toString(); joo_global_object.console.log("Dynlink: look for symbol ", name); if(current_libs[idx] && current_libs[idx][name]) return current_libs[idx][name]; diff --git a/runtime/toplevel.js b/runtime/toplevel.js index 06437014bf..5811722ebf 100644 --- a/runtime/toplevel.js +++ b/runtime/toplevel.js @@ -61,10 +61,8 @@ function caml_reify_bytecode (code, _sz) { //Requires: caml_failwith //Version: >= 4.08 function caml_reify_bytecode (code, _sz,_) { - if(joo_global_object.toplevelCompile) { - var x = joo_global_object.toplevelCompile(code); - return [0, 0, x]; - } + if(joo_global_object.toplevelCompile) + return [0, 0, joo_global_object.toplevelCompile(code)]; else caml_failwith("Toplevel not initialized (toplevelCompile)") } diff --git a/toplevel/examples/lwt_toplevel/dune b/toplevel/examples/lwt_toplevel/dune index 12454de9b2..d154d8e3d3 100644 --- a/toplevel/examples/lwt_toplevel/dune +++ b/toplevel/examples/lwt_toplevel/dune @@ -80,7 +80,6 @@ --toplevel --disable shortvar --noruntime - --pretty %{lib:js_of_ocaml-compiler:runtime.js} %{lib:js_of_ocaml-compiler:toplevel.js} %{lib:js_of_ocaml-compiler:dynlink.js} diff --git a/toplevel/lib/jsooTop.ml b/toplevel/lib/jsooTop.ml index c314897508..7e1fecfef8 100644 --- a/toplevel/lib/jsooTop.ml +++ b/toplevel/lib/jsooTop.ml @@ -100,6 +100,7 @@ let setup = res); Js.Unsafe.global##.toplevelReloc := Js.Unsafe.callback (fun name -> + let name = Js.to_string name in Js_of_ocaml_compiler.Ocaml_compiler.Symtable.reloc_ident name); ())