Skip to content

Commit 5070930

Browse files
committed
recursively map expr
1 parent 606a1cb commit 5070930

File tree

2 files changed

+24
-21
lines changed

2 files changed

+24
-21
lines changed

jscomp/frontend/bs_builtin_ppx.ml

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -228,15 +228,16 @@ let expr_mapper ~async_context ~in_function_def (self : mapper)
228228
let safe_module_type_lid : Ast_helper.lid =
229229
{txt = Lident (local_module_type_name txt); loc = me.pmod_loc}
230230
in
231-
{
232-
e with
233-
pexp_desc =
234-
Pexp_letmodule
235-
( lid,
236-
Ast_await.create_await_module_expression
237-
~module_type_lid:safe_module_type_lid me,
238-
expr );
239-
}
231+
self.expr self
232+
{
233+
e with
234+
pexp_desc =
235+
Pexp_letmodule
236+
( lid,
237+
Ast_await.create_await_module_expression
238+
~module_type_lid:safe_module_type_lid me,
239+
expr );
240+
}
240241
(* module M = await (Belt.List: BeltList) *)
241242
| Pexp_letmodule
242243
( lid,
@@ -248,15 +249,16 @@ let expr_mapper ~async_context ~in_function_def (self : mapper)
248249
} as me),
249250
expr )
250251
when Res_parsetree_viewer.hasAwaitAttribute pmod_attributes ->
251-
{
252-
e with
253-
pexp_desc =
254-
Pexp_letmodule
255-
( lid,
256-
Ast_await.create_await_module_expression ~module_type_lid:mtyp_lid
257-
me,
258-
expr );
259-
}
252+
self.expr self
253+
{
254+
e with
255+
pexp_desc =
256+
Pexp_letmodule
257+
( lid,
258+
Ast_await.create_await_module_expression ~module_type_lid:mtyp_lid
259+
me,
260+
expr );
261+
}
260262
| _ -> default_expr_mapper self e
261263

262264
let expr_mapper ~async_context ~in_function_def (self : mapper)

jscomp/test/Import.js

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)