Skip to content

Commit ab5f798

Browse files
committed
Restore compatibility with OCaml 4.14
1 parent 53d2d82 commit ab5f798

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

jscomp/ext/dune

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33
(wrapped false)
44
(preprocess
55
(action
6-
(run %{bin:cppo} %{env:CPPO_FLAGS=} %{input-file})))
6+
(run
7+
%{bin:cppo}
8+
-V
9+
OCAML:%{ocaml_version}
10+
%{env:CPPO_FLAGS=}
11+
%{input-file})))
712
(flags
813
(:standard -w +a-4-42-40-9-48-70))
914
(foreign_stubs

jscomp/ext/js_reserved_map.ml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,16 @@
2323
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
2424

2525
module STbl = struct
26-
include Hashtbl.Make (String)
26+
#if OCAML_VERSION >= (5, 0, 0)
27+
include Hashtbl.Make (String)
28+
#else
29+
module StringHash : Hashtbl.HashedType with type t = string = struct
30+
type t = string
31+
let equal = String.equal
32+
let hash = Hashtbl.hash (* polymorphic hash function *)
33+
end
34+
include Hashtbl.Make (StringHash)
35+
#endif
2736

2837
let of_array arr =
2938
let tbl = create (Array.length arr) in

0 commit comments

Comments
 (0)