@@ -71,36 +71,6 @@ let compile_group ({filename = file_name; env;} as meta : Lam_stats.t)
7171 Note the arity of [print_endline] is already analyzed before,
7272 so it should be safe
7373 *)
74- | Single (_ , ({name ="string_of_int" ;_} as id ),_ ), "pervasives.ml" ->
75- Js_output. of_stmt @@ S. alias_variable id
76- ~exp: (
77- let arg = Ext_ident. create " param" in
78- E. ocaml_fun [arg] [S. return_stmt (E. int_to_string (E. var arg))]
79- )
80-
81- (* * Special handling for values in [Sys] *)
82- | Single (_ , ({name ="max_array_length" | "max_string_length" ;_} as id ) ,_ ), "sys.ml" ->
83- (* See [js_knowledge] Array size section, can not be expressed by OCaml int,
84- note that casual handling of {!Sys.max_string_length} could result into
85- negative value which could cause wrong behavior of {!Buffer.create}
86- *)
87- Js_output. of_stmt @@ S. alias_variable id ~exp: (E. float " 2147483647" ) (* 2 ^ 31 - 1*)
88-
89- | Single (_ , ({name ="max_int" ;_} as id ) ,_ ), ("sys.ml" | "nativeint.ml" ) ->
90- (* See [js_knowledge] Max int section, (2. ** 53. -. 1.;;)
91- can not be expressed by OCaml int
92- FIXME: we need handle {!Nativeint} and {!Sys} differently
93- *)
94- Js_output. of_stmt @@ S. alias_variable id
95- ~exp: (E. float " 9007199254740991." )
96-
97- | Single (_ , ({name ="min_int" ;_} as id ) ,_ ), ("sys.ml" | "nativeint.ml" ) ->
98- (* See [js_knowledge] Max int section, -. (2. ** 53. -. 1.);;
99- can not be expressed by OCaml int
100- FIXME: we need handle {!Nativeint} and {!Sys} differently
101- *)
102- Js_output. of_stmt @@ S. alias_variable id
103- ~exp: (E. float (" -9007199254740991." ))
10474
10575 | Single (kind , id , lam ), _ ->
10676 (* let lam = Optimizer.simplify_lets [] lam in *)
0 commit comments