@@ -110,6 +110,8 @@ module L = struct
110
110
let ge = " >="
111
111
let plus_plus = " ++" (* FIXME: use (i = i + 1 | 0) instead *)
112
112
let minus_minus = " --"
113
+ let caml_block = " Block"
114
+ let caml_block_create = " __"
113
115
end
114
116
let return_indent = (String. length L. return / Ext_pp. indent_length)
115
117
@@ -892,28 +894,19 @@ and
892
894
893
895
| Number (Int { i = 0l ; _}) ,
894
896
(Blk_tuple | Blk_array | Blk_variant _ | Blk_record _ | Blk_na | Blk_module _
895
- | Blk_constructor (_, 1 )
897
+ | Blk_constructor (_, 1 ) (* Sync up with {!Js_dump} *)
896
898
)
897
- (* Hack to optimize option which is really pervasive in ocaml,
898
- we need concrete benchmark to support this
899
- *)
900
899
-> expression_desc cxt l f (Array (el, mutable_flag))
901
900
(* TODO: for numbers like 248, 255 we can reverse engineer to make it
902
901
[Obj.xx_flag], but we can not do this in runtime libraries
903
902
*)
904
903
905
904
| _, _
906
905
->
907
- expression_desc cxt l f
908
- (J. Object (
909
- let length, rev_list =
910
- List. fold_left (fun (i ,acc ) v ->
911
- (i+ 1 , (Js_op. Int_key i, v) :: acc)
912
- ) (0 , [] ) el in
913
- List. rev_append rev_list
914
- [(Js_op. Length , E. small_int length) ; (Js_op. Tag , tag)]
915
- )
916
- )
906
+ P. string f L. caml_block;
907
+ P. string f L. dot ;
908
+ P. string f L. caml_block_create;
909
+ P. paren_group f 1 (fun _ -> arguments cxt f [tag; E. arr mutable_flag el])
917
910
end
918
911
| Caml_block_tag e ->
919
912
P. group f 1 (fun _ ->
0 commit comments