Skip to content

Commit 2b6d237

Browse files
authored
Spring cleaning: Frontend (#6127)
* Spring cleaning: no cppo on frontend. * format
1 parent 8963643 commit 2b6d237

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+2836
-3057
lines changed

jscomp/frontend/.ocamlformat

Lines changed: 0 additions & 1 deletion
This file was deleted.

jscomp/frontend/ast_async.ml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
1-
let add_promise_type ?(loc=Location.none) ~async (result : Parsetree.expression) =
1+
let add_promise_type ?(loc = Location.none) ~async
2+
(result : Parsetree.expression) =
23
if async then
34
let unsafe_async =
45
Ast_helper.Exp.ident ~loc
5-
{ txt = Ldot (Ldot (Lident "Js", "Promise"), "unsafe_async"); loc }
6+
{txt = Ldot (Ldot (Lident "Js", "Promise"), "unsafe_async"); loc}
67
in
7-
Ast_helper.Exp.apply ~loc unsafe_async [ (Nolabel, result) ]
8+
Ast_helper.Exp.apply ~loc unsafe_async [(Nolabel, result)]
89
else result
910

1011
let add_async_attribute ~async (body : Parsetree.expression) =
1112
if async then
1213
{
1314
body with
1415
pexp_attributes =
15-
({ txt = "res.async"; loc = Location.none }, PStr [])
16+
({txt = "res.async"; loc = Location.none}, PStr [])
1617
:: body.pexp_attributes;
1718
}
1819
else body
1920

2021
let rec add_promise_to_result ~loc (e : Parsetree.expression) =
2122
match e.pexp_desc with
2223
| Pexp_fun (label, eo, pat, body) ->
23-
let body = add_promise_to_result ~loc body in
24-
{ e with pexp_desc = Pexp_fun (label, eo, pat, body) }
24+
let body = add_promise_to_result ~loc body in
25+
{e with pexp_desc = Pexp_fun (label, eo, pat, body)}
2526
| _ -> add_promise_type ~loc ~async:true e
2627

2728
let make_function_async ~async (e : Parsetree.expression) =

0 commit comments

Comments
 (0)