Skip to content

Commit f8e4596

Browse files
committed
not carrying redundant cst for label
1 parent a969187 commit f8e4596

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

jscomp/core/lam_compile_external_call.ml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ let ocaml_to_js_eff
100100
| Optional ->
101101
Js_of_lam_option.get_default_undefined_from_optional raw_arg
102102
| Label | Empty -> raw_arg
103-
| LabelCst _
103+
| LabelCst
104104
| EmptyCst
105105
-> assert false in
106106
match arg_type with
@@ -177,7 +177,7 @@ let assemble_args_no_splice call_loc ffi
177177
| [], _
178178
-> assert (args = []) ; empty_pair
179179
| { arg_label = EmptyCst ; arg_type = Arg_cst cst } :: labels, args
180-
| { arg_label = LabelCst {cst ;}; _} :: labels, args ->
180+
| { arg_label = LabelCst ; arg_type = Arg_cst cst} :: labels, args ->
181181
let accs, eff = aux labels args in
182182
Lam_compile_const.translate_arg_cst cst :: accs, eff
183183
| {arg_label = Empty | Label | Optional as arg_label ; arg_type } ::labels,
@@ -189,7 +189,7 @@ let assemble_args_no_splice call_loc ffi
189189
append_list acc accs, Ext_list.append new_eff eff
190190
| { arg_label = Empty | Label | Optional ; _ } :: _ , []
191191
-> assert false
192-
| {arg_label = EmptyCst ; _} :: _, _ -> assert false
192+
| {arg_label = EmptyCst | LabelCst ; _} :: _, _ -> assert false
193193
in
194194
let args, eff = aux arg_types args in
195195
args,
@@ -205,7 +205,7 @@ let assemble_args_has_splice call_loc ffi (arg_types : specs) (args : exprs)
205205
match labels, args with
206206
| [] , _ -> assert (args = []); empty_pair
207207
| { arg_label = EmptyCst ; arg_type = Arg_cst cst} :: labels , args
208-
| { arg_label = LabelCst {cst}; _} :: labels , args ->
208+
| { arg_label = LabelCst ; arg_type = Arg_cst cst } :: labels , args ->
209209
let accs, eff = aux labels args in
210210
Lam_compile_const.translate_arg_cst cst :: accs, eff
211211
| ({arg_label = Empty | Label | Optional as arg_label; arg_type }) ::labels,
@@ -222,7 +222,7 @@ let assemble_args_has_splice call_loc ffi (arg_types : specs) (args : exprs)
222222
end
223223
| { arg_label = Empty | Label | Optional ; _ } :: _ , []
224224
-> assert false
225-
| {arg_label = EmptyCst ;_ } :: _, _ -> assert false
225+
| {arg_label = EmptyCst | LabelCst ;_ } :: _, _ -> assert false
226226
in
227227
let args, eff = aux arg_types args in
228228
args,

jscomp/syntax/ast_external_process.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -906,8 +906,8 @@ let handle_attributes
906906
param_type :: arg_types end
907907
| Labelled s ->
908908
begin match refine_arg_type ~nolabel:false ty with
909-
| new_ty, (Arg_cst i as arg_type) ->
910-
LabelCst {cst = i}, arg_type, arg_types
909+
| new_ty, (Arg_cst _ as arg_type) ->
910+
LabelCst , arg_type, arg_types
911911
| new_ty, arg_type ->
912912
Label , arg_type,
913913
{param_type with ty = new_ty} :: arg_types

jscomp/syntax/external_arg_spec.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ type cst =
3535

3636
type label_noname =
3737
| Label
38-
| LabelCst of { cst : cst }
38+
| LabelCst
3939
| Empty
4040
| EmptyCst
4141
| Optional

jscomp/syntax/external_arg_spec.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ type attr =
5353

5454
type label_noname =
5555
| Label
56-
| LabelCst of { cst : cst }
56+
| LabelCst
5757
| Empty
5858
| EmptyCst
5959
| Optional

0 commit comments

Comments
 (0)