Skip to content

Commit 1bf1afd

Browse files
committed
clean up
1 parent bd6744c commit 1bf1afd

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

jscomp/core/js_dump.ml

+4-2
Original file line numberDiff line numberDiff line change
@@ -766,12 +766,14 @@ and expression_desc cxt ~(level : int) f x : cxt =
766766
in
767767
if p.num_nonconst = 1 && not !Js_config.debug then
768768
pp_comment_option f (Some p.name);
769-
let objs = if List.length p.optional_labels <> 0 then
769+
let objs = match p.optional_labels with
770+
| [] -> objs
771+
| _ ->
770772
Ext_list.array_list_filter_map p.fields el (fun f x ->
771773
match x.expression_desc with
772774
| Undefined when List.mem f p.optional_labels -> None
773775
| _ -> Some (Js_op.Lit f, x))
774-
else objs in
776+
in
775777
expression_desc cxt ~level f (Object objs)
776778
| Caml_block (el, _, tag, Blk_constructor p) ->
777779
let not_is_cons = p.name <> Literals.cons in

lib/4.06.1/unstable/js_compiler.ml

+4-2
Original file line numberDiff line numberDiff line change
@@ -81749,12 +81749,14 @@ and expression_desc cxt ~(level : int) f x : cxt =
8174981749
in
8175081750
if p.num_nonconst = 1 && not !Js_config.debug then
8175181751
pp_comment_option f (Some p.name);
81752-
let objs = if List.length p.optional_labels <> 0 then
81752+
let objs = match p.optional_labels with
81753+
| [] -> objs
81754+
| _ ->
8175381755
Ext_list.array_list_filter_map p.fields el (fun f x ->
8175481756
match x.expression_desc with
8175581757
| Undefined when List.mem f p.optional_labels -> None
8175681758
| _ -> Some (Js_op.Lit f, x))
81757-
else objs in
81759+
in
8175881760
expression_desc cxt ~level f (Object objs)
8175981761
| Caml_block (el, _, tag, Blk_constructor p) ->
8176081762
let not_is_cons = p.name <> Literals.cons in

lib/4.06.1/unstable/js_playground_compiler.ml

+4-2
Original file line numberDiff line numberDiff line change
@@ -81749,12 +81749,14 @@ and expression_desc cxt ~(level : int) f x : cxt =
8174981749
in
8175081750
if p.num_nonconst = 1 && not !Js_config.debug then
8175181751
pp_comment_option f (Some p.name);
81752-
let objs = if List.length p.optional_labels <> 0 then
81752+
let objs = match p.optional_labels with
81753+
| [] -> objs
81754+
| _ ->
8175381755
Ext_list.array_list_filter_map p.fields el (fun f x ->
8175481756
match x.expression_desc with
8175581757
| Undefined when List.mem f p.optional_labels -> None
8175681758
| _ -> Some (Js_op.Lit f, x))
81757-
else objs in
81759+
in
8175881760
expression_desc cxt ~level f (Object objs)
8175981761
| Caml_block (el, _, tag, Blk_constructor p) ->
8176081762
let not_is_cons = p.name <> Literals.cons in

lib/4.06.1/whole_compiler.ml

+4-2
Original file line numberDiff line numberDiff line change
@@ -257581,12 +257581,14 @@ and expression_desc cxt ~(level : int) f x : cxt =
257581257581
in
257582257582
if p.num_nonconst = 1 && not !Js_config.debug then
257583257583
pp_comment_option f (Some p.name);
257584-
let objs = if List.length p.optional_labels <> 0 then
257584+
let objs = match p.optional_labels with
257585+
| [] -> objs
257586+
| _ ->
257585257587
Ext_list.array_list_filter_map p.fields el (fun f x ->
257586257588
match x.expression_desc with
257587257589
| Undefined when List.mem f p.optional_labels -> None
257588257590
| _ -> Some (Js_op.Lit f, x))
257589-
else objs in
257591+
in
257590257592
expression_desc cxt ~level f (Object objs)
257591257593
| Caml_block (el, _, tag, Blk_constructor p) ->
257592257594
let not_is_cons = p.name <> Literals.cons in

0 commit comments

Comments
 (0)