Skip to content

Commit

Permalink
add more compat
Browse files Browse the repository at this point in the history
  • Loading branch information
cometkim committed Sep 22, 2024
1 parent 686eedd commit fe725f5
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion jscomp/ml/translcore.ml
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,28 @@ let comparisons_table =
bigintcomp = Pbigintcomp Ceq;
simplify_constant_constructor = false;
} );

(* FIXME: Core compatibility *)
( "%bs_min",
{
objcomp = Pobjmax;
intcomp = Pintmax;
boolcomp = Pboolmax;
floatcomp = Pboolmax;
stringcomp = Pstringmax;
bigintcomp = Pbigintmax;
simplify_constant_constructor = false;
} );
( "%bs_max",
{
objcomp = Pobjmin;
intcomp = Pintmin;
boolcomp = Pboolmin;
floatcomp = Pfloatmin;
stringcomp = Pstringmin;
bigintcomp = Pbigintmin;
simplify_constant_constructor = false;
} );
|]

let primitives_table =
Expand Down Expand Up @@ -360,7 +382,10 @@ let primitives_table =
("#null", Pundefined);
("#undefined", Pundefined);
("#is_nullable", Pisnullable);
("#nullable_to_opt", Pnullable_to_opt);
("#null_to_opt", Pnullable_to_opt);
("#nullable_to_opt", Pnull_to_opt);
("#undefined_to_opt", Pundefined_to_opt);
("#makemutablelist", Pmakelist Mutable);
|]

let find_primitive prim_name = Hashtbl.find primitives_table prim_name
Expand Down

0 comments on commit fe725f5

Please sign in to comment.