5050
5151*)
5252
53-
53+ let name_symbol = Js_op. Symbol_name
5454module P = Ext_pp
5555module E = Js_exp_make
5656(* module S = Js_stmt_make *)
@@ -125,11 +125,11 @@ let exn_block_as_obj
125125 | _ -> assert false in
126126 Object (
127127 if stack then
128- Ext_list. mapi_append el (fun i e -> field_name i, e)
129- [" Error" ,
128+ Ext_list. mapi_append el (fun i e -> Js_op. Lit ( field_name i) , e)
129+ [ Js_op. Lit " Error" ,
130130 E. new_ (E. js_global " Error" ) []
131131 ]
132- else Ext_list. mapi el (fun i e -> field_name i, e)
132+ else Ext_list. mapi el (fun i e -> Js_op. Lit ( field_name i) , e)
133133 )
134134
135135let rec iter_lst cxt (f : P.t ) ls element inter =
@@ -812,10 +812,13 @@ and expression_desc cxt ~(level:int) f x : cxt =
812812 E. runtime_call Js_runtime_modules. option " some" [e])
813813 | Caml_block (el ,_ , _ , Blk_module fields ) ->
814814 expression_desc cxt ~level f (Object (
815- (Ext_list. map_combine fields el Ext_ident. convert)))
815+ (Ext_list. map_combine
816+ fields el
817+ (fun x -> Js_op. Lit (Ext_ident. convert x) ))))
816818 (* name convention of Record is slight different from modules*)
817819 | Caml_block (el ,_ , _ , Blk_record fields ) ->
818- expression_desc cxt ~level f (Object ((Ext_list. combine_array fields el )))
820+ expression_desc cxt ~level f (Object
821+ ((Ext_list. combine_array fields el (fun i -> Js_op. Lit i))))
819822
820823 | Caml_block (el ,_ ,_ , Blk_poly_var name ) ->
821824 begin match el with
@@ -825,13 +828,13 @@ and expression_desc cxt ~(level:int) f x : cxt =
825828 ~level
826829 f
827830 (Object
828- ((Literals. polyvar_hash,
831+ ((Js_op. Lit Literals. polyvar_hash,
829832 if ! Js_config. debug then hash
830833 else {hash with comment = Some name}
831834 ) ::
832- (Literals. polyvar_value, value) ::
835+ (Js_op. Lit Literals. polyvar_value, value) ::
833836 if ! Js_config. debug then
834- [" name " , E. str name]
837+ [name_symbol , E. str name]
835838 else []
836839 )
837840 )
@@ -843,11 +846,11 @@ and expression_desc cxt ~(level:int) f x : cxt =
843846 let objs =
844847 let tails =
845848 Ext_list. combine_array_append p.fields el
846- (if ! Js_config. debug then [" NAME " ,E. str p.name]
849+ (if ! Js_config. debug then [name_symbol ,E. str p.name]
847850 else []
848- ) in
851+ ) ( fun i -> Js_op. Lit i) in
849852 if p.num_nonconst = 1 then tails
850- else (L. tag,
853+ else (Js_op. Lit L. tag,
851854 if ! Js_config. debug then tag else {tag with comment = Some p.name}) :: tails in
852855 if p.num_nonconst = 1 && not ! Js_config. debug then
853856 pp_comment_option f (Some p.name);
@@ -858,17 +861,17 @@ and expression_desc cxt ~(level:int) f x : cxt =
858861 let tails =
859862 Ext_list. mapi_append el (fun i e ->
860863 (match is_cons, i with
861- | true , 0 -> Literals. hd
862- | true , 1 -> Literals. tl
864+ | true , 0 -> Js_op. Lit Literals. hd
865+ | true , 1 -> Js_op. Lit Literals. tl
863866 | _ ->
864- " _" ^ string_of_int i) , e )
867+ Js_op. Lit ( " _" ^ string_of_int i) ) , e )
865868 (if ! Js_config. debug then
866- [" NAME " , E. str p.name]
869+ [name_symbol , E. str p.name]
867870 else [] ) in
868871 if p.num_nonconst = 1 then
869872 tails
870873 else
871- (L. tag,
874+ (Js_op. Lit L. tag,
872875 if ! Js_config. debug then tag else {tag with comment = Some p.name}) :: tails
873876 in
874877 if p.num_nonconst = 1 && not ! Js_config. debug
0 commit comments