Skip to content

Commit 056d579

Browse files
committed
WIP
1 parent 2696483 commit 056d579

File tree

5 files changed

+20
-10
lines changed

5 files changed

+20
-10
lines changed
File renamed without changes.

compiler/tests-jsoo/dune

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
test_bigarray
4949
test_marshal_compressed
5050
test_parsing
51+
test_custom
5152
calc_parser
5253
calc_lexer))
5354
(libraries unix compiler-libs.common js_of_ocaml-compiler)
@@ -66,6 +67,16 @@
6667
(modules test_float16 test_bigarray)
6768
(modes js wasm native))
6869

70+
(test
71+
(name test_custom)
72+
(modules test_custom)
73+
(libraries js_of_ocaml)
74+
(js_of_ocaml
75+
(javascript_files custom.js))
76+
(wasm_of_ocaml
77+
(javascript_files custom.js))
78+
(modes js wasm))
79+
6980
(ocamlyacc calc_parser)
7081

7182
(ocamllex calc_lexer)

compiler/tests-jsoo/test_custom.ml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
open Js_of_ocaml
2+
3+
let () =
4+
let p : Js.js_string Js.t = Jsoo_runtime.Sys.external_ "process" in
5+
let o : _ Js.t = Jsoo_runtime.Sys.external_ "obj" in
6+
let del = Jsoo_runtime.Sys.external_ "caml_js_delete" in
7+
ignore (Js.Unsafe.fun_call del [| o; Js.Unsafe.coerce (Js.string "process") |]);
8+
print_endline (Js.to_string p)

examples/boulderdash/boulderdash.ml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -510,12 +510,4 @@ let start _ =
510510
Dom.appendChild body div;
511511
Lwt.return ()
512512

513-
let () =
514-
let p : Js.js_string Js.t = Jsoo_runtime.Sys.external_ "process" in
515-
let o : _ Js.t = Jsoo_runtime.Sys.external_ "obj" in
516-
let del : 'a -> Jsoo_runtime.Js.t -> unit =
517-
Jsoo_runtime.Sys.external_ "caml_js_delete"
518-
in
519-
del o (Jsoo_runtime.Js.string "process");
520-
print_endline (Js.to_string p);
521-
Lwt.async start
513+
let () = Lwt.async start

examples/boulderdash/dune

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
(modes js wasm)
55
(js_of_ocaml
66
(compilation_mode separate)
7-
(javascript_files custom.js)
87
(build_runtime_flags :standard --file %{dep:maps.txt} --file maps))
98
(link_deps
109
(glob_files maps/*.map))

0 commit comments

Comments
 (0)