Skip to content

Commit

Permalink
Fix JS runtime.
Browse files Browse the repository at this point in the history
  • Loading branch information
toots committed May 1, 2024
1 parent a7760d0 commit e35a0e4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 12 deletions.
15 changes: 3 additions & 12 deletions src/js/dune
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
(env
(release
(js_of_ocaml
(flags
(:standard --enable effects))
(build_runtime_flags
(:standard --enable effects))))
(dev
(js_of_ocaml
(flags
(:standard --enable effects))
(build_runtime_flags
(:standard --enable effects)))
(flags
(:standard -w -7-9 -warn-error -33))))

(library
(name liquidsoap_js)
(public_name liquidsoap-js)
(optional)
(modules init_js)
(modules)
(js_of_ocaml
(javascript_files runtime.js))
(preprocess
(pps js_of_ocaml-ppx))
(libraries liquidsoap_lang liquidsoap_tooling))
Expand Down
4 changes: 4 additions & 0 deletions src/js/interactive_js.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
open Js_of_ocaml
open Liquidsoap_lang

let () =
(Hooks.liq_libs_dir := fun () -> "/static");
Runtime.load_libs ~stdlib:"stdlib_js.liq" ()

let execute ~throw expr =
(try
try
Expand Down
17 changes: 17 additions & 0 deletions src/js/runtime.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//Provides: caml_thread_initialize
function caml_thread_initialize() {};

//Provides: caml_mutex_new
function caml_mutex_new() {}

//Provides: caml_thread_self
function caml_thread_self() {}

//Provides: caml_thread_id
function caml_thread_id() {}

//Provides: caml_mutex_lock
function caml_mutex_lock() {}

//Provides: caml_mutex_unlock
function caml_mutex_unlock() {}

0 comments on commit e35a0e4

Please sign in to comment.