Commit 44ef0bb 1 parent 22a0945 commit 44ef0bb Copy full SHA for 44ef0bb
File tree 1 file changed +8
-7
lines changed
1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -812,15 +812,16 @@ let parseFloat (s : js_string t) : number_t =
812
812
let s = Unsafe. fun_call Unsafe. global##.parseFloat [| Unsafe. inject s |] in
813
813
if isNaN s then failwith " parseFloat" else s
814
814
815
- let _ =
816
- Printexc. register_printer (function
817
- | Js_error. Exn e -> Some (Js_error. to_string e)
818
- | _ -> None )
819
-
820
815
let _ =
821
816
Printexc. register_printer (fun e ->
822
- let e : < .. > t = Obj. magic e in
823
- if instanceof e array_constructor then None else Some (to_string e##toString ))
817
+ if instanceof (Obj. magic e : < .. > t ) error_constr
818
+ then
819
+ let e = Js_error. of_error (Obj. magic e : error t ) in
820
+ Some (Js_error. to_string e)
821
+ else
822
+ match e with
823
+ | Js_error. Exn e -> Some (Js_error. to_string e)
824
+ | _ -> None )
824
825
825
826
let export_js (field : js_string t ) x =
826
827
Unsafe. set
You can’t perform that action at this time.
0 commit comments