Skip to content

Commit

Permalink
remove duplicated function
Browse files Browse the repository at this point in the history
  • Loading branch information
mununki committed Oct 3, 2023
1 parent e896491 commit 8126a13
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 13 deletions.
File renamed without changes.
10 changes: 0 additions & 10 deletions jscomp/syntax/src/react_jsx_common.ml
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,6 @@ let removeArity binding =
in
{binding with pvb_expr = removeArityRecord binding.pvb_expr}

let add_async_attribute ~async (body : Parsetree.expression) =
if async then
{
body with
pexp_attributes =
({txt = "res.async"; loc = Location.none}, PStr [])
:: body.pexp_attributes;
}
else body

let is_async : Parsetree.attribute -> bool =
fun ({txt}, _) -> txt = "async" || txt = "res.async"

Expand Down
4 changes: 1 addition & 3 deletions jscomp/syntax/src/reactjs_jsx_v4.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1091,9 +1091,7 @@ let mapBinding ~config ~emptyLoc ~pstr_loc ~fileName ~recFlag binding =
| _ -> [Typ.any ()]))))
expression
in
let expression =
React_jsx_common.add_async_attribute ~async:isAsync expression
in
let expression = Ast_async.add_async_attribute ~async:isAsync expression in
let expression =
(* Add new tupes (type a,b,c) to make's definition *)
newtypes
Expand Down

0 comments on commit 8126a13

Please sign in to comment.