diff --git a/compiler/tests-full/dune b/compiler/tests-full/dune index 5effacad3b..5f55bb9cd0 100644 --- a/compiler/tests-full/dune +++ b/compiler/tests-full/dune @@ -1,7 +1,9 @@ (rule (targets stdlib.cma.js) (enabled_if - (= %{ocaml_version} "5.2.0")) + (and + (>= %{ocaml_version} "5.2") + (< %{ocaml_version} "5.3"))) (action (run %{bin:js_of_ocaml} @@ -14,7 +16,9 @@ (rule (targets stdlib.cma.output.js) (enabled_if - (= %{ocaml_version} "5.2.0")) + (and + (>= %{ocaml_version} "5.2") + (< %{ocaml_version} "5.3"))) (action (with-stdout-to %{targets} @@ -23,7 +27,9 @@ (rule (alias runtest) (enabled_if - (= %{ocaml_version} "5.2.0")) + (and + (>= %{ocaml_version} "5.2") + (< %{ocaml_version} "5.3"))) (action (diff stdlib.cma.expected.js stdlib.cma.output.js))) diff --git a/compiler/tests-full/stdlib.cma.expected.js b/compiler/tests-full/stdlib.cma.expected.js index 099faef92e..a314cd8eeb 100644 --- a/compiler/tests-full/stdlib.cma.expected.js +++ b/compiler/tests-full/stdlib.cma.expected.js @@ -1121,8 +1121,8 @@ caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, caml_wrap_exception = runtime.caml_wrap_exception, global_data = runtime.caml_get_global_data(), - ocaml_version = "5.2.0", - ocaml_release = [0, 5, 2, 0, 0], + ocaml_version = "5.2.1", + ocaml_release = [0, 5, 2, 1, 0], Stdlib = global_data.Stdlib, executable_name = /*<>*/ runtime.caml_sys_executable_name(0), @@ -23571,26 +23571,26 @@ /*<>*/ return caml_call2(Stdlib_Atomic[4], a, 0) /*<>*/ ; } function create_alarm(f){ - var _y_ = /*<>*/ caml_call1(Stdlib_Atomic[1], 1); - /*<>*/ caml_call1 + var alarm = /*<>*/ caml_call1(Stdlib_Atomic[1], 1); + /*<>*/ caml_call1 (Stdlib_Domain[6], function(param){ - /*<>*/ return delete_alarm(_y_) /*<>*/ ; + /*<>*/ return delete_alarm(alarm) /*<>*/ ; }); - /*<>*/ return _y_; - /*<>*/ } + /*<>*/ return alarm; + /*<>*/ } var null_tracker = /*<>*/ [0, - function(param){ /*<>*/ return 0; /*<>*/ }, - function(param){ /*<>*/ return 0; /*<>*/ }, - function(param){ /*<>*/ return 0; /*<>*/ }, - function(param){ /*<>*/ return 0; /*<>*/ }, - function(param){ /*<>*/ return 0; /*<>*/ }]; + function(param){ /*<>*/ return 0; /*<>*/ }, + function(param){ /*<>*/ return 0; /*<>*/ }, + function(param){ /*<>*/ return 0; /*<>*/ }, + function(param){ /*<>*/ return 0; /*<>*/ }, + function(param){ /*<>*/ return 0; /*<>*/ }]; function start(sampling_rate, opt, tracker){ - var callstack_size = /*<>*/ opt ? opt[1] : Stdlib[19]; - /*<>*/ return runtime.caml_memprof_start - (sampling_rate, callstack_size, tracker) /*<>*/ ; + var callstack_size = /*<>*/ opt ? opt[1] : Stdlib[19]; + /*<>*/ return runtime.caml_memprof_start + (sampling_rate, callstack_size, tracker) /*<>*/ ; } var Stdlib_Gc = diff --git a/dune b/dune index c68dad2d65..292467727b 100644 --- a/dune +++ b/dune @@ -46,4 +46,6 @@ %{dep:VERSION} %{dep:tools/version/GIT-VERSION})))) -(data_only_dirs _wikidoc doc-dev) +(data_only_dirs _wikidoc doc-dev jane-street) + +(vendored_dirs) diff --git a/runtime/wasm/effect.wat b/runtime/wasm/effect.wat index 5bc8678f2a..c8932c2d9b 100644 --- a/runtime/wasm/effect.wat +++ b/runtime/wasm/effect.wat @@ -24,7 +24,7 @@ (func $caml_fresh_oo_id (param (ref eq)) (result (ref eq)))) (import "obj" "cont_tag" (global $cont_tag i32)) (import "stdlib" "caml_named_value" - (func $caml_named_value (param (ref $string)) (result (ref null eq)))) + (func $caml_named_value (param (ref eq)) (result (ref null eq)))) (import "fail" "ocaml_exception" (tag $ocaml_exception (param (ref eq)))) (import "fail" "javascript_exception" (tag $javascript_exception (param externref))) diff --git a/runtime/wasm/jslib.wat b/runtime/wasm/jslib.wat index b4468e8dea..b15f2809a7 100644 --- a/runtime/wasm/jslib.wat +++ b/runtime/wasm/jslib.wat @@ -77,7 +77,7 @@ (import "fail" "caml_failwith_tag" (func $caml_failwith_tag (result (ref eq)))) (import "stdlib" "caml_named_value" - (func $caml_named_value (param (ref $string)) (result (ref null eq)))) + (func $caml_named_value (param (ref eq)) (result (ref null eq)))) (import "obj" "caml_callback_1" (func $caml_callback_1 (param (ref eq)) (param (ref eq)) (result (ref eq)))) @@ -89,6 +89,9 @@ (func $jsstring_of_string (param (ref $string)) (result anyref))) (import "jsstring" "string_of_jsstring" (func $string_of_jsstring (param anyref) (result (ref $string)))) + (import "jsstring" "jsstring_of_substring" + (func $jsstring_of_substring + (param (ref $string) i32 i32) (result anyref))) (import "int32" "caml_copy_int32" (func $caml_copy_int32 (param i32) (result (ref eq)))) (import "int32" "Int32_val" @@ -459,6 +462,16 @@ (local.set $s (ref.cast (ref $string) (local.get 0))) (return (struct.new $js (call $jsstring_of_string (local.get $s))))) + (func (export "caml_jsstring_of_substring") + (param $s (ref eq)) (param $i (ref eq)) (param $l (ref eq)) + (result (ref eq)) + (return + (struct.new $js + (call $jsstring_of_substring + (ref.cast (ref $string) (local.get $s)) + (i31.get_u (ref.cast (ref i31) (local.get $i))) + (i31.get_u (ref.cast (ref i31) (local.get $l))))))) + (func $caml_jsbytes_of_string (export "caml_jsbytes_of_string") (param (ref eq)) (result (ref eq)) (local $s (ref $string)) diff --git a/runtime/wasm/stdlib.wat b/runtime/wasm/stdlib.wat index 89ca56e627..5176402152 100644 --- a/runtime/wasm/stdlib.wat +++ b/runtime/wasm/stdlib.wat @@ -79,7 +79,7 @@ (br $loop)))) (func $caml_named_value (export "caml_named_value") - (param $s (ref $string)) (result (ref null eq)) + (param $s (ref eq)) (result (ref null eq)) (block $not_found (return (struct.get $assoc 1 diff --git a/tools/ci_setup.ml b/tools/ci_setup.ml index 8ec9bb034c..d64dfbc7fc 100644 --- a/tools/ci_setup.ml +++ b/tools/ci_setup.ml @@ -266,7 +266,7 @@ let () = let branch = if is_forked nm then - if List.mem nm [ "bonsai"; "virtual_dom"; "async_js" ] + if List.mem nm [ "bonsai"; "virtual_dom"; "async_js"; "zarith_stubs_js" ] then Some "jsoo-6" else Some "wasm" else None