Skip to content

Commit bb3e30b

Browse files
committed
Add js_bigint.ml and use BigInt.t instead of bigint_val
1 parent 7498b6d commit bb3e30b

14 files changed

+534
-511
lines changed

jscomp/main/builtin_cmi_datasets.ml

Lines changed: 98 additions & 96 deletions
Large diffs are not rendered by default.

jscomp/main/builtin_cmj_datasets.ml

Lines changed: 30 additions & 28 deletions
Large diffs are not rendered by default.

jscomp/others/js.ml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,3 +296,6 @@ module Vector = Js_vector
296296

297297
module Console = Js_console
298298
(** Provides bindings for console *)
299+
300+
module BigInt = Js_bigint
301+
(** Provide bindings for BigInt *)

jscomp/others/js_bigint.ml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
(** JavaScript BigInt API *)
2+
3+
type t

jscomp/others/js_types.ml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@
2727
type symbol
2828
(** Js symbol type only available in ES6 *)
2929

30-
type bigint_val
31-
(** Js bigint type only available in ES2020 *)
32-
3330
type obj_val
3431
type undefined_val
3532
(** This type has only one value `undefined` *)
@@ -48,9 +45,7 @@ type _ t =
4845
| Function : function_val t
4946
| Object : obj_val t
5047
| Symbol : symbol t
51-
| BigInt : bigint_val t
52-
53-
48+
| BigInt : Js_bigint.t t
5449

5550
type tagged_t =
5651
| JSFalse
@@ -62,7 +57,7 @@ type tagged_t =
6257
| JSFunction of function_val
6358
| JSObject of obj_val
6459
| JSSymbol of symbol
65-
| JSBigInt of bigint_val
60+
| JSBigInt of Js_bigint.t
6661

6762
let classify (x : 'a) : tagged_t =
6863
let ty = Js.typeof x in

jscomp/others/js_types.mli

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@
2727
type symbol
2828
(** Js symbol type (only available in ES6) *)
2929

30-
type bigint_val
31-
(** Js bigint type only available in ES2020 *)
32-
3330
type obj_val
3431

3532
type undefined_val
@@ -49,7 +46,7 @@ type _ t =
4946
| Function : function_val t
5047
| Object : obj_val t
5148
| Symbol : symbol t
52-
| BigInt : bigint_val t
49+
| BigInt : Js_bigint.t t
5350

5451
val test : 'a -> 'b t -> bool
5552
(**
@@ -73,6 +70,6 @@ type tagged_t =
7370
| JSFunction of function_val
7471
| JSObject of obj_val
7572
| JSSymbol of symbol
76-
| JSBigInt of bigint_val
73+
| JSBigInt of Js_bigint.t
7774

7875
val classify : 'a -> tagged_t

jscomp/others/release.ninja

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ o others/node.cmj others/node.cmi : cc others/node.ml | $bsc others/js.cmi other
1919
o others/js_OO.cmi others/js_OO.cmj : cc others/js_OO.ml | others/belt_internals.cmi others/js.cmi $bsc
2020
o others/js_array.cmi others/js_array.cmj : cc others/js_array.ml | others/belt_internals.cmi others/js.cmi others/js_array2.cmj $bsc
2121
o others/js_array2.cmi others/js_array2.cmj : cc others/js_array2.ml | others/belt_internals.cmi others/js.cmi $bsc
22+
o others/js_bigint.cmi others/js_bigint.cmj : cc others/js_bigint.ml | others/belt_internals.cmi others/js.cmi $bsc
2223
o others/js_cast.cmj : cc_cmi others/js_cast.ml | others/belt_internals.cmi others/js.cmi others/js_cast.cmi $bsc
2324
o others/js_cast.cmi : cc others/js_cast.mli | others/belt_internals.cmi others/js.cmi $bsc
2425
o others/js_console.cmi others/js_console.cmj : cc others/js_console.ml | others/belt_internals.cmi others/js.cmi $bsc
@@ -52,13 +53,13 @@ o others/js_string.cmi others/js_string.cmj : cc others/js_string.ml | others/be
5253
o others/js_string2.cmi others/js_string2.cmj : cc others/js_string2.ml | others/belt_internals.cmi others/js.cmi others/js_array2.cmj others/js_re.cmj $bsc
5354
o others/js_typed_array.cmi others/js_typed_array.cmj : cc others/js_typed_array.ml | others/belt_internals.cmi others/js.cmi others/js.cmj others/js_typed_array2.cmj $bsc
5455
o others/js_typed_array2.cmi others/js_typed_array2.cmj : cc others/js_typed_array2.ml | others/belt_internals.cmi others/js.cmi others/js.cmj $bsc
55-
o others/js_types.cmj : cc_cmi others/js_types.ml | others/belt_internals.cmi others/js.cmi others/js.cmj others/js_null.cmj others/js_types.cmi $bsc
56-
o others/js_types.cmi : cc others/js_types.mli | others/belt_internals.cmi others/js.cmi $bsc
56+
o others/js_types.cmj : cc_cmi others/js_types.ml | others/belt_internals.cmi others/js.cmi others/js.cmj others/js_bigint.cmj others/js_null.cmj others/js_types.cmi $bsc
57+
o others/js_types.cmi : cc others/js_types.mli | others/belt_internals.cmi others/js.cmi others/js_bigint.cmj $bsc
5758
o others/js_undefined.cmj : cc_cmi others/js_undefined.ml | others/belt_internals.cmi others/js.cmi others/js.cmj others/js_exn.cmj others/js_undefined.cmi $bsc
5859
o others/js_undefined.cmi : cc others/js_undefined.mli | others/belt_internals.cmi others/js.cmi others/js.cmj $bsc
5960
o others/js_vector.cmj : cc_cmi others/js_vector.ml | others/belt_internals.cmi others/js.cmi others/js_array2.cmj others/js_vector.cmi $bsc
6061
o others/js_vector.cmi : cc others/js_vector.mli | others/belt_internals.cmi others/js.cmi $bsc
61-
o js_pkg : phony others/js_OO.cmi others/js_OO.cmj others/js_array.cmi others/js_array.cmj others/js_array2.cmi others/js_array2.cmj others/js_cast.cmi others/js_cast.cmj others/js_console.cmi others/js_console.cmj others/js_date.cmi others/js_date.cmj others/js_dict.cmi others/js_dict.cmj others/js_exn.cmi others/js_exn.cmj others/js_float.cmi others/js_float.cmj others/js_global.cmi others/js_global.cmj others/js_int.cmi others/js_int.cmj others/js_json.cmi others/js_json.cmj others/js_list.cmi others/js_list.cmj others/js_mapperRt.cmi others/js_mapperRt.cmj others/js_math.cmi others/js_math.cmj others/js_null.cmi others/js_null.cmj others/js_null_undefined.cmi others/js_null_undefined.cmj others/js_obj.cmi others/js_obj.cmj others/js_option.cmi others/js_option.cmj others/js_promise.cmi others/js_promise.cmj others/js_re.cmi others/js_re.cmj others/js_result.cmi others/js_result.cmj others/js_string.cmi others/js_string.cmj others/js_string2.cmi others/js_string2.cmj others/js_typed_array.cmi others/js_typed_array.cmj others/js_typed_array2.cmi others/js_typed_array2.cmj others/js_types.cmi others/js_types.cmj others/js_undefined.cmi others/js_undefined.cmj others/js_vector.cmi others/js_vector.cmj
62+
o js_pkg : phony others/js_OO.cmi others/js_OO.cmj others/js_array.cmi others/js_array.cmj others/js_array2.cmi others/js_array2.cmj others/js_bigint.cmi others/js_bigint.cmj others/js_cast.cmi others/js_cast.cmj others/js_console.cmi others/js_console.cmj others/js_date.cmi others/js_date.cmj others/js_dict.cmi others/js_dict.cmj others/js_exn.cmi others/js_exn.cmj others/js_float.cmi others/js_float.cmj others/js_global.cmi others/js_global.cmj others/js_int.cmi others/js_int.cmj others/js_json.cmi others/js_json.cmj others/js_list.cmi others/js_list.cmj others/js_mapperRt.cmi others/js_mapperRt.cmj others/js_math.cmi others/js_math.cmj others/js_null.cmi others/js_null.cmj others/js_null_undefined.cmi others/js_null_undefined.cmj others/js_obj.cmi others/js_obj.cmj others/js_option.cmi others/js_option.cmj others/js_promise.cmi others/js_promise.cmj others/js_re.cmi others/js_re.cmj others/js_result.cmi others/js_result.cmj others/js_string.cmi others/js_string.cmj others/js_string2.cmi others/js_string2.cmj others/js_typed_array.cmi others/js_typed_array.cmj others/js_typed_array2.cmi others/js_typed_array2.cmj others/js_types.cmi others/js_types.cmj others/js_undefined.cmi others/js_undefined.cmj others/js_vector.cmi others/js_vector.cmj
6263
o others/belt_Array.cmj : cc_cmi others/belt_Array.ml | others/belt.cmi others/belt_Array.cmi others/belt_internals.cmi others/js.cmi others/js.cmj others/js_math.cmj $bsc js_pkg
6364
o others/belt_Array.cmi : cc others/belt_Array.mli | others/belt.cmi others/belt_internals.cmi others/js.cmi others/js.cmj $bsc js_pkg
6465
o others/belt_Float.cmj : cc_cmi others/belt_Float.ml | others/belt.cmi others/belt_Float.cmi others/belt_internals.cmi others/js.cmi $bsc js_pkg

0 commit comments

Comments
 (0)