diff --git a/hosts/ocaml/lib/sx_primitives.ml b/hosts/ocaml/lib/sx_primitives.ml index 090f1c0..e35c22d 100644 --- a/hosts/ocaml/lib/sx_primitives.ml +++ b/hosts/ocaml/lib/sx_primitives.ml @@ -119,7 +119,10 @@ let () = register "parse-int" (fun args -> match args with | [String s] -> (match int_of_string_opt s with Some n -> Number (float_of_int n) | None -> Nil) - | [Number n] -> Number (float_of_int (int_of_float n)) + | [String s; default_val] -> + (match int_of_string_opt s with Some n -> Number (float_of_int n) | None -> default_val) + | [Number n] | [Number n; _] -> Number (float_of_int (int_of_float n)) + | [_; default_val] -> default_val | _ -> Nil); register "parse-float" (fun args -> match args with diff --git a/shared/sx/ocaml_bridge.py b/shared/sx/ocaml_bridge.py index 679c44e..bbc13d3 100644 --- a/shared/sx/ocaml_bridge.py +++ b/shared/sx/ocaml_bridge.py @@ -439,16 +439,6 @@ class OcamlBridge: skipped += 1 _logger.warning("OCaml load skipped %s: %s", filepath, e) - # JIT workaround: reset functions with known compilation bugs. - # cssx-resolve has a complex cond that the JIT miscompiles - # (colour branch skipped even when conditions are true). - # Resetting forces CEK interpretation. - try: - await self._send('(vm-reset-fn "cssx-resolve")') - await self._read_until_ok(ctx=None) - except OcamlBridgeError: - pass - # SSR overrides: effect is a no-op on the server (prevents # reactive loops during island SSR — effects are DOM side-effects) try: