File tree 4 files changed +56
-32
lines changed
4 files changed +56
-32
lines changed Original file line number Diff line number Diff line change @@ -757,6 +757,20 @@ and expression_desc cxt ~(level : int) f x : cxt =
757
757
(if ! Js_config. debug then [ (name_symbol, E. str p.name) ] else [] )
758
758
(fun i -> Js_op. Lit i)
759
759
in
760
+ let is_optional (names : string list ) (pname : Js_op.property_name ) =
761
+ match pname with
762
+ | Lit n -> Ext_list. mem_string names n
763
+ | Symbol_name -> false
764
+ in
765
+ let tails =
766
+ match p.optional_labels with
767
+ | [] -> tails
768
+ | _ ->
769
+ Ext_list. filter_map tails (fun (f , x ) ->
770
+ match x.expression_desc with
771
+ | Undefined when is_optional p.optional_labels f -> None
772
+ | _ -> Some (f, x))
773
+ in
760
774
if p.num_nonconst = 1 then tails
761
775
else
762
776
( Js_op. Lit L. tag,
@@ -766,14 +780,6 @@ and expression_desc cxt ~(level : int) f x : cxt =
766
780
in
767
781
if p.num_nonconst = 1 && not ! Js_config. debug then
768
782
pp_comment_option f (Some p.name);
769
- let objs = match p.optional_labels with
770
- | [] -> objs
771
- | _ ->
772
- Ext_list. array_list_filter_map p.fields el (fun f x ->
773
- match x.expression_desc with
774
- | Undefined when List. mem f p.optional_labels -> None
775
- | _ -> Some (Js_op. Lit f, x))
776
- in
777
783
expression_desc cxt ~level f (Object objs)
778
784
| Caml_block (el , _ , tag , Blk_constructor p ) ->
779
785
let not_is_cons = p.name <> Literals. cons in
Original file line number Diff line number Diff line change @@ -81740,6 +81740,20 @@ and expression_desc cxt ~(level : int) f x : cxt =
81740
81740
(if !Js_config.debug then [ (name_symbol, E.str p.name) ] else [])
81741
81741
(fun i -> Js_op.Lit i)
81742
81742
in
81743
+ let is_optional (names: string list) (pname: Js_op.property_name) =
81744
+ match pname with
81745
+ | Lit n -> Ext_list.mem_string names n
81746
+ | Symbol_name -> false
81747
+ in
81748
+ let tails =
81749
+ match p.optional_labels with
81750
+ | [] -> tails
81751
+ | _ ->
81752
+ Ext_list.filter_map tails (fun (f, x) ->
81753
+ match x.expression_desc with
81754
+ | Undefined when is_optional p.optional_labels f -> None
81755
+ | _ -> Some (f, x))
81756
+ in
81743
81757
if p.num_nonconst = 1 then tails
81744
81758
else
81745
81759
( Js_op.Lit L.tag,
@@ -81749,14 +81763,6 @@ and expression_desc cxt ~(level : int) f x : cxt =
81749
81763
in
81750
81764
if p.num_nonconst = 1 && not !Js_config.debug then
81751
81765
pp_comment_option f (Some p.name);
81752
- let objs = match p.optional_labels with
81753
- | [] -> objs
81754
- | _ ->
81755
- Ext_list.array_list_filter_map p.fields el (fun f x ->
81756
- match x.expression_desc with
81757
- | Undefined when List.mem f p.optional_labels -> None
81758
- | _ -> Some (Js_op.Lit f, x))
81759
- in
81760
81766
expression_desc cxt ~level f (Object objs)
81761
81767
| Caml_block (el, _, tag, Blk_constructor p) ->
81762
81768
let not_is_cons = p.name <> Literals.cons in
Original file line number Diff line number Diff line change @@ -81740,6 +81740,20 @@ and expression_desc cxt ~(level : int) f x : cxt =
81740
81740
(if !Js_config.debug then [ (name_symbol, E.str p.name) ] else [])
81741
81741
(fun i -> Js_op.Lit i)
81742
81742
in
81743
+ let is_optional (names: string list) (pname: Js_op.property_name) =
81744
+ match pname with
81745
+ | Lit n -> Ext_list.mem_string names n
81746
+ | Symbol_name -> false
81747
+ in
81748
+ let tails =
81749
+ match p.optional_labels with
81750
+ | [] -> tails
81751
+ | _ ->
81752
+ Ext_list.filter_map tails (fun (f, x) ->
81753
+ match x.expression_desc with
81754
+ | Undefined when is_optional p.optional_labels f -> None
81755
+ | _ -> Some (f, x))
81756
+ in
81743
81757
if p.num_nonconst = 1 then tails
81744
81758
else
81745
81759
( Js_op.Lit L.tag,
@@ -81749,14 +81763,6 @@ and expression_desc cxt ~(level : int) f x : cxt =
81749
81763
in
81750
81764
if p.num_nonconst = 1 && not !Js_config.debug then
81751
81765
pp_comment_option f (Some p.name);
81752
- let objs = match p.optional_labels with
81753
- | [] -> objs
81754
- | _ ->
81755
- Ext_list.array_list_filter_map p.fields el (fun f x ->
81756
- match x.expression_desc with
81757
- | Undefined when List.mem f p.optional_labels -> None
81758
- | _ -> Some (Js_op.Lit f, x))
81759
- in
81760
81766
expression_desc cxt ~level f (Object objs)
81761
81767
| Caml_block (el, _, tag, Blk_constructor p) ->
81762
81768
let not_is_cons = p.name <> Literals.cons in
Original file line number Diff line number Diff line change @@ -257572,6 +257572,20 @@ and expression_desc cxt ~(level : int) f x : cxt =
257572
257572
(if !Js_config.debug then [ (name_symbol, E.str p.name) ] else [])
257573
257573
(fun i -> Js_op.Lit i)
257574
257574
in
257575
+ let is_optional (names: string list) (pname: Js_op.property_name) =
257576
+ match pname with
257577
+ | Lit n -> Ext_list.mem_string names n
257578
+ | Symbol_name -> false
257579
+ in
257580
+ let tails =
257581
+ match p.optional_labels with
257582
+ | [] -> tails
257583
+ | _ ->
257584
+ Ext_list.filter_map tails (fun (f, x) ->
257585
+ match x.expression_desc with
257586
+ | Undefined when is_optional p.optional_labels f -> None
257587
+ | _ -> Some (f, x))
257588
+ in
257575
257589
if p.num_nonconst = 1 then tails
257576
257590
else
257577
257591
( Js_op.Lit L.tag,
@@ -257581,14 +257595,6 @@ and expression_desc cxt ~(level : int) f x : cxt =
257581
257595
in
257582
257596
if p.num_nonconst = 1 && not !Js_config.debug then
257583
257597
pp_comment_option f (Some p.name);
257584
- let objs = match p.optional_labels with
257585
- | [] -> objs
257586
- | _ ->
257587
- Ext_list.array_list_filter_map p.fields el (fun f x ->
257588
- match x.expression_desc with
257589
- | Undefined when List.mem f p.optional_labels -> None
257590
- | _ -> Some (Js_op.Lit f, x))
257591
- in
257592
257598
expression_desc cxt ~level f (Object objs)
257593
257599
| Caml_block (el, _, tag, Blk_constructor p) ->
257594
257600
let not_is_cons = p.name <> Literals.cons in
You can’t perform that action at this time.
0 commit comments