Skip to content

Commit e20ae9a

Browse files
committed
remove one use of Obj.magic
1 parent 5ead996 commit e20ae9a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

jscomp/runtime/caml_js_exceptions.ml

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11

22

3-
type t
3+
type t =
4+
| Any : 'a -> t [@@unboxed]
45

5-
exception Error of t
6+
exception Error of t
67

78

89
(**
@@ -18,10 +19,10 @@ exception Error of t
1819
let internalToOCamlException (e : Caml_obj_extern.t) =
1920
if Caml_exceptions.caml_is_extension e then
2021
(Obj.magic e : exn)
21-
else Error (Obj.magic (e : Caml_obj_extern.t) : t)
22+
else Error (Any e)
2223

2324
let caml_as_js_exn exn =
2425
match exn with
2526
| Error t ->
26-
Some t
27+
Some t
2728
| _ -> None

0 commit comments

Comments
 (0)