Skip to content

Commit 90a4454

Browse files
committed
drop/rename more interfaces
1 parent bd215bf commit 90a4454

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+209
-586
lines changed

jscomp/core/js_of_lam_option.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ let get_default_undefined_from_optional (arg : J.expression) : J.expression =
7878
if Js_analyzer.is_okay_to_duplicate arg then
7979
(* FIXME: no need do such inlining*)
8080
E.econd (is_not_none arg) (val_from_option arg) E.undefined
81-
else E.runtime_call Js_runtime_modules.option "option_get" [ arg ]
81+
else E.runtime_call Js_runtime_modules.option "toUndefined" [ arg ]
8282

8383
let option_unwrap (arg : J.expression) : J.expression =
8484
let desc = arg.expression_desc in
@@ -87,7 +87,7 @@ let option_unwrap (arg : J.expression) : J.expression =
8787
match desc with
8888
| Optional_block (x, _) -> E.poly_var_value_access x
8989
(* invariant: option encoding *)
90-
| _ -> E.runtime_call Js_runtime_modules.option "option_unwrap" [ arg ]
90+
| _ -> E.runtime_call Js_runtime_modules.option "unwrapPolyVar" [ arg ]
9191

9292
let destruct_optional ~for_sure_none ~for_sure_some ~not_sure
9393
(arg : J.expression) =

jscomp/core/lam.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,7 @@ module Lift = struct
462462
let bool b = if b then true_ else false_
463463

464464
let string s : t = Lconst (Const_string { s; unicode = false })
465+
465466
let char b : t = Lconst (Const_char b)
466467
end
467468

jscomp/core/lam_compile_primitive.ml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -96,22 +96,22 @@ let translate output_prefix loc (cxt : Lam_compile_context.t)
9696
| [ e ] -> (
9797
match e.expression_desc with
9898
| Var _ | Undefined _ | Null -> Js_of_lam_option.null_to_opt e
99-
| _ -> E.runtime_call Js_runtime_modules.option "null_to_opt" args)
99+
| _ -> E.runtime_call Js_runtime_modules.option "fromNull" args)
100100
| _ -> assert false)
101101
| Pundefined_to_opt -> (
102102
match args with
103103
| [ e ] -> (
104104
match e.expression_desc with
105105
| Var _ | Undefined _ | Null -> Js_of_lam_option.undef_to_opt e
106106
| _ ->
107-
E.runtime_call Js_runtime_modules.option "undefined_to_opt" args)
107+
E.runtime_call Js_runtime_modules.option "fromUndefined" args)
108108
| _ -> assert false)
109109
| Pnull_undefined_to_opt -> (
110110
match args with
111111
| [ e ] -> (
112112
match e.expression_desc with
113113
| Var _ | Undefined _ | Null -> Js_of_lam_option.null_undef_to_opt e
114-
| _ -> E.runtime_call Js_runtime_modules.option "nullable_to_opt" args
114+
| _ -> E.runtime_call Js_runtime_modules.option "fromNullable" args
115115
)
116116
| _ -> assert false)
117117
(* Compile %import: The module argument for dynamic import is represented as a path,
@@ -299,15 +299,9 @@ let translate output_prefix loc (cxt : Lam_compile_context.t)
299299
| [ range; e ] -> E.is_out (E.offset e off) range
300300
| _ -> assert false)
301301
| Pstringlength -> E.string_length (Ext_list.singleton_exn args)
302-
| Pstringrefs -> E.runtime_call Js_runtime_modules.string "get" args
303-
(* For bytes and string, they both return [int] in ocaml
304-
we need tell Pbyteref from Pstringref
305-
1. Pbyteref -> a[i]
306-
2. Pstringref -> a.charCodeAt (a[i] is wrong)
307-
*)
308-
| Pstringrefu -> (
302+
| Pstringrefs | Pstringrefu -> (
309303
match args with
310-
| [ e; e1 ] -> Js_of_lam_string.ref_string e e1
304+
| [ e; e1 ] -> E.runtime_call Js_runtime_modules.string "getChar" args
311305
| _ -> assert false)
312306
(* polymorphic operations *)
313307
| Pobjcomp cmp -> (

jscomp/core/lam_pass_lets_dce.ml

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -189,31 +189,6 @@ let lets_helper (count_var : Ident.t -> Lam_pass_count.used_info) lam : Lam.t =
189189
Lam.const (Const_string { s = l_s^r_s; unicode = false })
190190
end
191191
end
192-
193-
| Lprim {primitive = (Pstringrefu|Pstringrefs) as primitive ;
194-
args = [l;r] ; loc
195-
} -> (* TODO: introudce new constant *)
196-
let l' = simplif l in
197-
let r' = simplif r in
198-
let opt_l =
199-
match l' with
200-
| Lconst (Const_string { s = ls; unicode = false }) ->
201-
Some ls
202-
| Lvar i -> Hash_ident.find_opt string_table i
203-
| _ -> None in
204-
begin match opt_l with
205-
| None -> Lam.prim ~primitive ~args:[l';r'] loc
206-
| Some l_s ->
207-
match r with
208-
|Lconst((Const_int {i})) ->
209-
let i = Int32.to_int i in
210-
if i < String.length l_s && i >= 0 then
211-
Lam.const ((Const_char (Char.code l_s.[i])))
212-
else
213-
Lam.prim ~primitive ~args:[l';r'] loc
214-
| _ ->
215-
Lam.prim ~primitive ~args:[l';r'] loc
216-
end
217192
| Lglobal_module _ -> lam
218193
| Lprim {primitive; args; loc}
219194
-> Lam.prim ~primitive ~args:(Ext_list.map args simplif) loc

jscomp/ext/ext_pervasives.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* along with this program; if not, write to the Free Software
2323
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
2424

25-
external reraise : exn -> 'a = "%reraise"
25+
external reraise : exn -> 'a = "%raise"
2626

2727
let finally v ~clean:action f =
2828
match f v with

jscomp/ext/ext_pervasives.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
(** Extension to standard library [Pervavives] module, safe to open
2626
*)
2727

28-
external reraise : exn -> 'a = "%reraise"
28+
external reraise : exn -> 'a = "%raise"
2929

3030
val finally : 'a -> clean:('a -> unit) -> ('a -> 'b) -> 'b
3131

jscomp/ext/js_runtime_modules.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ let hash = "Primitive_hash"
5050

5151
let deriving = "Runtime_deriving"
5252

53-
let astExtensions = "Runtime_ast_extensions"
54-
5553
let exceptions = "Caml_exceptions"
5654

5755
let curry = "Curry"

jscomp/ml/translcore.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,6 @@ let primitives_table =
216216
("%obj_set_field", Parraysetu);
217217

218218
("%raise", Praise Raise_regular);
219-
("%reraise", Praise Raise_reraise);
220-
("%raise_notrace", Praise Raise_notrace);
221219

222220
(* bool primitives *)
223221
("%sequand", Psequand);

jscomp/runtime/bs_stdlib_mini.resi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ external \"*.": (float, float) => float = "%mulfloat"
5151
external \"/.": (float, float) => float = "%divfloat"
5252

5353
module Obj: {
54-
type t
54+
type t /* FIXME: Primitive_object.t */
5555
external field: (t, int) => t = "%obj_field"
5656
external tag: t => int = "%obj_tag"
5757
external repr: 'a => t = "%identity"

jscomp/runtime/caml_undefined_extern.res

Lines changed: 0 additions & 4 deletions
This file was deleted.

jscomp/runtime/char.res

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// FIXME:
2+
// This exists for compatibility reason.
3+
// Move this into Pervasives or Core
4+
5+
type t = char
6+
7+
external code: t => int = "%identity"
8+
external unsafe_chr: int => t = "%identity"
9+
10+
let chr = unsafe_chr

jscomp/runtime/lazy.res

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// FIXME:
2+
// This exists for compatibility reason.
3+
// Move this into Pervasives or Core
4+
15
type t<'a> = lazy_t<'a>
26

37
exception Undefined = Primitive_lazy.Undefined
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
external code: char => int = "%identity"
2+
external unsafe_chr: int => char = "%identity"

jscomp/runtime/primitive_option.res

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,21 @@ let some = (x: Obj.t): Obj.t =>
4141
x
4242
}
4343

44-
let nullable_to_opt = (type t, x: Js.nullable<t>): option<t> =>
44+
let fromNullable = (type t, x: Js.nullable<t>): option<t> =>
4545
if Js.isNullable(x) {
4646
None
4747
} else {
4848
Obj.magic(some((Obj.magic(x): 'a)))
4949
}
5050

51-
let undefined_to_opt = (type t, x: Js.undefined<t>): option<t> =>
51+
let fromUndefined = (type t, x: Js.undefined<t>): option<t> =>
5252
if Obj.magic(x) === Js.undefined {
5353
None
5454
} else {
5555
Obj.magic(some((Obj.magic(x): 'a)))
5656
}
5757

58-
let null_to_opt = (type t, x: Js.null<t>): option<t> =>
58+
let fromNull = (type t, x: Js.null<t>): option<t> =>
5959
if Obj.magic(x) === Js.null {
6060
None
6161
} else {
@@ -79,20 +79,17 @@ let valFromOption = (x: Obj.t): Obj.t =>
7979
Obj.magic(x)
8080
}
8181

82-
let option_get = (x: option<'a>) =>
82+
let toUndefined = (x: option<'a>) =>
8383
if x == None {
84-
Caml_undefined_extern.empty
84+
Js.undefined
8585
} else {
8686
Obj.magic(valFromOption(Obj.repr(x)))
8787
}
8888

89-
type poly = {
90-
@as("HASH") hash: int /* Literals.polyvar_hash */,
91-
@as("VAL") value: Obj.t,
92-
}
89+
type poly = {@as("VAL") value: Obj.t}
9390

9491
/** [input] is optional polymorphic variant */
95-
let option_unwrap = (x: option<poly>) =>
92+
let unwrapPolyVar = (x: option<poly>) =>
9693
switch x {
9794
| None => Obj.repr(x)
9895
| Some(x) => x.value

jscomp/runtime/primitive_option.resi

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,23 @@
2424

2525
type nested = {@as("BS_PRIVATE_NESTED_SOME_NONE") depth: int}
2626

27-
let nullable_to_opt: Js.null_undefined<'a> => option<'a>
27+
let fromNullable: Js.null_undefined<'a> => option<'a>
2828

29-
let undefined_to_opt: Js.undefined<'a> => option<'a>
29+
let fromUndefined: Js.undefined<'a> => option<'a>
3030

31-
let null_to_opt: Js.null<'a> => option<'a>
31+
let fromNull: Js.null<'a> => option<'a>
3232

3333
let valFromOption: Primitive_object_extern.t => Primitive_object_extern.t
3434

3535
let some: Primitive_object_extern.t => Primitive_object_extern.t
3636

3737
let isNested: Primitive_object_extern.t => bool
3838

39-
let option_get: option<Primitive_object_extern.t> => Caml_undefined_extern.t<
40-
Primitive_object_extern.t,
41-
>
39+
let toUndefined: option<Primitive_object_extern.t> => Js.undefined<Primitive_object_extern.t>
4240

4341
type poly
4442

45-
/** When it is None, return none
46-
When it is (Some (`a 3)) return 3
43+
/** When it is None, return None
44+
When it is Some (#a(3)) return 3
4745
*/
48-
let option_unwrap: option<poly> => Primitive_object_extern.t
46+
let unwrapPolyVar: option<poly> => Primitive_object_extern.t

jscomp/runtime/primitive_string.res

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,13 @@ let max = (x: string, y: string): string =>
2121
y
2222
}
2323

24-
// TODO: delete
25-
let get = (s, i) =>
24+
let getChar = (s, i) =>
2625
if i >= Primitive_string_extern.length(s) || i < 0 {
2726
raise(Invalid_argument("index out of bounds"))
2827
} else {
29-
Primitive_string_extern.unsafe_get(s, i)
28+
Primitive_string_extern.getChar(s, i)
3029
}
3130

3231
// TODO: delete
3332
let make = (n, ch: char): string =>
34-
Primitive_string_extern.of_char(ch)->Primitive_string_extern.repeat(n)
33+
Primitive_string_extern.fromChar(ch)->Primitive_string_extern.repeat(n)

jscomp/runtime/primitive_string_extern.res

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,33 +22,11 @@
2222
* along with this program; if not, write to the Free Software
2323
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
2424

25-
/*** TODO: check with {!String.of_char}
26-
it's quite common that we have
27-
{[ Caml_string_extern.of_char x.[0] ]}
28-
It would be nice to generate code as below
29-
{[ x[0]
30-
]}
31-
*/
32-
33-
/* ATT: this relies on we encode `char' as int */
34-
@val external of_char: char => string = "String.fromCharCode"
35-
@get_index external get_string_unsafe: (string, int) => string = ""
36-
37-
@send external toUpperCase: string => string = "toUpperCase"
38-
@send external of_int: (int, ~base: int) => string = "toString"
39-
@send external slice: (string, int, int) => string = "slice"
40-
@send external slice_rest: (string, int) => string = "slice"
41-
@send external index_of: (string, string) => int = "indexOf"
42-
43-
@val
44-
external of_small_int_array: (@as(json`null`) _, array<int>) => string = "String.fromCharCode.apply"
45-
46-
@val @variadic external of_small_int32_array: array<int> => string = "String.fromCharCode"
25+
external length: string => int = "%string_length"
4726

48-
@send external lastIndexOf: (string, string) => int = "lastIndexOf" /* used in {!Caml_io} */
27+
@send external getChar: (string, int) => char = "codePointAt"
4928

50-
external length: string => int = "%string_length"
51-
external unsafe_get: (string, int) => char = "%string_unsafe_get"
52-
external get: (string, int) => char = "%string_unsafe_get"
29+
@scope("String")
30+
external fromChar: char => string = "fromCodePoint"
5331

5432
@send external repeat: (string, int) => string = "repeat"

jscomp/runtime/release.ninja

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,28 @@ o runtime/lazy.cmj : cc_cmi runtime/lazy.res | runtime/lazy.cmi runtime/primitiv
1919
o runtime/lazy.cmi : cc runtime/lazy.resi | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj
2020
o runtime/primitive_hash.cmj : cc_cmi runtime/primitive_hash.res | runtime/obj.cmj runtime/primitive_hash.cmi runtime/primitive_object_extern.cmj
2121
o runtime/primitive_hash.cmi : cc runtime/primitive_hash.resi | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj runtime/primitive_object.cmi
22-
o runtime/primitive_lazy.cmj : cc_cmi runtime/primitive_lazy.res | runtime/primitive_lazy.cmi
22+
o runtime/primitive_lazy.cmj : cc_cmi runtime/primitive_lazy.res | runtime/caml_exceptions.cmj runtime/primitive_lazy.cmi
2323
o runtime/primitive_lazy.cmi : cc runtime/primitive_lazy.resi | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj
2424
o runtime/primitive_module.cmj : cc_cmi runtime/primitive_module.res | runtime/lazy.cmj runtime/obj.cmj runtime/primitive_module.cmi runtime/primitive_object_extern.cmj
2525
o runtime/primitive_module.cmi : cc runtime/primitive_module.resi | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj runtime/primitive_object.cmi
26-
o runtime/primitive_object.cmj : cc_cmi runtime/primitive_object.res | runtime/primitive_object.cmi runtime/primitive_object_extern.cmj runtime/primitive_option.cmj
26+
o runtime/primitive_object.cmj : cc_cmi runtime/primitive_object.res | runtime/primitive_bool.cmj runtime/primitive_float.cmj runtime/primitive_int.cmj runtime/primitive_object.cmi runtime/primitive_object_extern.cmj runtime/primitive_option.cmj runtime/primitive_string.cmj
2727
o runtime/primitive_object.cmi : cc runtime/primitive_object.resi | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj runtime/primitive_object_extern.cmj
28-
o runtime/primitive_option.cmj : cc_cmi runtime/primitive_option.res | runtime/caml_undefined_extern.cmj runtime/primitive_object_extern.cmj runtime/primitive_option.cmi
29-
o runtime/primitive_option.cmi : cc runtime/primitive_option.resi | runtime/bs_stdlib_mini.cmi runtime/caml_undefined_extern.cmj runtime/js.cmi runtime/js.cmj runtime/primitive_object_extern.cmj
28+
o runtime/primitive_option.cmj : cc_cmi runtime/primitive_option.res | runtime/primitive_object_extern.cmj runtime/primitive_option.cmi
29+
o runtime/primitive_option.cmi : cc runtime/primitive_option.resi | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj runtime/primitive_object_extern.cmj
3030
o runtime/caml_js_exceptions.cmi runtime/caml_js_exceptions.cmj : cc runtime/caml_js_exceptions.res | runtime/bs_stdlib_mini.cmi runtime/caml_exceptions.cmj runtime/js.cmi runtime/js.cmj runtime/primitive_object_extern.cmj
31-
o runtime/caml_undefined_extern.cmi runtime/caml_undefined_extern.cmj : cc runtime/caml_undefined_extern.res | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj
31+
o runtime/char.cmi runtime/char.cmj : cc runtime/char.res | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj
3232
o runtime/curry.cmi runtime/curry.cmj : cc runtime/curry.res | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj runtime/obj.cmj runtime/primitive_object_extern.cmj
3333
o runtime/obj.cmi runtime/obj.cmj : cc runtime/obj.res | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj runtime/primitive_object_extern.cmj
3434
o runtime/primitive_array.cmi runtime/primitive_array.cmj : cc runtime/primitive_array.res | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj
3535
o runtime/primitive_bigint.cmi runtime/primitive_bigint.cmj : cc runtime/primitive_bigint.res | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj
3636
o runtime/primitive_bool.cmi runtime/primitive_bool.cmj : cc runtime/primitive_bool.res | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj
37+
o runtime/primitive_char_extern.cmi runtime/primitive_char_extern.cmj : cc runtime/primitive_char_extern.res | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj
3738
o runtime/primitive_dict.cmi runtime/primitive_dict.cmj : cc runtime/primitive_dict.res | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj
3839
o runtime/primitive_float.cmi runtime/primitive_float.cmj : cc runtime/primitive_float.res | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj
3940
o runtime/primitive_int.cmi runtime/primitive_int.cmj : cc runtime/primitive_int.res | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj
4041
o runtime/primitive_object_extern.cmi runtime/primitive_object_extern.cmj : cc runtime/primitive_object_extern.res | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj
4142
o runtime/primitive_promise.cmi runtime/primitive_promise.cmj : cc runtime/primitive_promise.res | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj
4243
o runtime/primitive_string.cmi runtime/primitive_string.cmj : cc runtime/primitive_string.res | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj runtime/primitive_string_extern.cmj
4344
o runtime/primitive_string_extern.cmi runtime/primitive_string_extern.cmj : cc runtime/primitive_string_extern.res | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj
44-
o runtime : phony runtime/bs_stdlib_mini.cmi runtime/js.cmj runtime/js.cmi runtime/caml_exceptions.cmi runtime/caml_exceptions.cmj runtime/lazy.cmi runtime/lazy.cmj runtime/primitive_hash.cmi runtime/primitive_hash.cmj runtime/primitive_lazy.cmi runtime/primitive_lazy.cmj runtime/primitive_module.cmi runtime/primitive_module.cmj runtime/primitive_object.cmi runtime/primitive_object.cmj runtime/primitive_option.cmi runtime/primitive_option.cmj runtime/caml_js_exceptions.cmi runtime/caml_js_exceptions.cmj runtime/caml_undefined_extern.cmi runtime/caml_undefined_extern.cmj runtime/curry.cmi runtime/curry.cmj runtime/obj.cmi runtime/obj.cmj runtime/primitive_array.cmi runtime/primitive_array.cmj runtime/primitive_bigint.cmi runtime/primitive_bigint.cmj runtime/primitive_bool.cmi runtime/primitive_bool.cmj runtime/primitive_dict.cmi runtime/primitive_dict.cmj runtime/primitive_float.cmi runtime/primitive_float.cmj runtime/primitive_int.cmi runtime/primitive_int.cmj runtime/primitive_object_extern.cmi runtime/primitive_object_extern.cmj runtime/primitive_promise.cmi runtime/primitive_promise.cmj runtime/primitive_string.cmi runtime/primitive_string.cmj runtime/primitive_string_extern.cmi runtime/primitive_string_extern.cmj
45+
o runtime/string.cmi runtime/string.cmj : cc runtime/string.res | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj runtime/primitive_string.cmj runtime/primitive_string_extern.cmj
46+
o runtime : phony runtime/bs_stdlib_mini.cmi runtime/js.cmj runtime/js.cmi runtime/caml_exceptions.cmi runtime/caml_exceptions.cmj runtime/lazy.cmi runtime/lazy.cmj runtime/primitive_hash.cmi runtime/primitive_hash.cmj runtime/primitive_lazy.cmi runtime/primitive_lazy.cmj runtime/primitive_module.cmi runtime/primitive_module.cmj runtime/primitive_object.cmi runtime/primitive_object.cmj runtime/primitive_option.cmi runtime/primitive_option.cmj runtime/caml_js_exceptions.cmi runtime/caml_js_exceptions.cmj runtime/char.cmi runtime/char.cmj runtime/curry.cmi runtime/curry.cmj runtime/obj.cmi runtime/obj.cmj runtime/primitive_array.cmi runtime/primitive_array.cmj runtime/primitive_bigint.cmi runtime/primitive_bigint.cmj runtime/primitive_bool.cmi runtime/primitive_bool.cmj runtime/primitive_char_extern.cmi runtime/primitive_char_extern.cmj runtime/primitive_dict.cmi runtime/primitive_dict.cmj runtime/primitive_float.cmi runtime/primitive_float.cmj runtime/primitive_int.cmi runtime/primitive_int.cmj runtime/primitive_object_extern.cmi runtime/primitive_object_extern.cmj runtime/primitive_promise.cmi runtime/primitive_promise.cmj runtime/primitive_string.cmi runtime/primitive_string.cmj runtime/primitive_string_extern.cmi runtime/primitive_string_extern.cmj runtime/string.cmi runtime/string.cmj

jscomp/runtime/string.res

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// FIXME:
2+
// This exists for compatibility reason.
3+
// Move this into Pervasives or Core
4+
5+
type t = string
6+
let length = Primitive_string_extern.length
7+
let get = Primitive_string_extern.getChar
8+
let unsafe_get = Primitive_string_extern.getChar
9+
let compare = (x: t, y: t) => Pervasives.compare(x, y)
10+
let equal: (string, string) => bool = (a, b) => a == b

0 commit comments

Comments
 (0)