Skip to content

Commit d66d436

Browse files
committed
Fixes after review
1 parent f575e0c commit d66d436

File tree

2 files changed

+2
-24
lines changed

2 files changed

+2
-24
lines changed

jscomp/frontend/ast_external_process.ml

+2-23
Original file line numberDiff line numberDiff line change
@@ -349,27 +349,6 @@ type response = {
349349
no_inline_cross_module: bool;
350350
}
351351

352-
let get_maybe_obj_field_alias attributes =
353-
attributes
354-
|> List.find_map (fun (attr : Parsetree.attribute) ->
355-
match attr with
356-
| ( {txt = "as"; _},
357-
PStr
358-
[
359-
{
360-
pstr_desc =
361-
Pstr_eval
362-
( {
363-
pexp_desc = Pexp_constant (Pconst_string (alias, _));
364-
_;
365-
},
366-
_ );
367-
_;
368-
};
369-
] ) ->
370-
Some alias
371-
| _ -> None)
372-
373352
let process_obj (loc : Location.t) (st : external_desc) (prim_name : string)
374353
(arg_types_ty : Ast_core_type.param_type list)
375354
(result_type : Ast_core_type.t) : Parsetree.core_type * External_ffi_types.t
@@ -421,7 +400,7 @@ let process_obj (loc : Location.t) (st : external_desc) (prim_name : string)
421400
"expect label, optional, or unit here")
422401
| Labelled label -> (
423402
let fieldName =
424-
match get_maybe_obj_field_alias param_type.attr with
403+
match Ast_attributes.iter_process_bs_string_as param_type.attr with
425404
| Some alias -> alias
426405
| None -> label
427406
in
@@ -481,7 +460,7 @@ let process_obj (loc : Location.t) (st : external_desc) (prim_name : string)
481460
"%@obj label %s does not support %@unwrap arguments" label)
482461
| Optional label -> (
483462
let fieldName =
484-
match get_maybe_obj_field_alias param_type.attr with
463+
match Ast_attributes.iter_process_bs_string_as param_type.attr with
485464
| Some alias -> alias
486465
| None -> label
487466
in

jscomp/gentype/TranslateStructure.ml

-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ and addAnnotationsToFields ~config (expr : Typedtree.expression)
5757
| _ -> (fields, argTypes)
5858
[@@live]
5959

60-
[@@live]
6160
(** Recover from expr the renaming annotations on named arguments. *)
6261
let addAnnotationsToFunctionType ~config (expr : Typedtree.expression)
6362
(type_ : type_) =

0 commit comments

Comments
 (0)