Skip to content

Commit 63fc87b

Browse files
committed
Map prop spreading
1 parent bbfe816 commit 63fc87b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

compiler/ml/ast_mapper_from0.ml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,9 @@ module E = struct
343343
|> skip_last_two_elements
344344
|> List.filter_map (fun (lbl, e) ->
345345
match (lbl, e) with
346+
| Asttypes.Noloc.Labelled "_spreadProps", expr ->
347+
Some
348+
(Parsetree.JSXPropSpreading (Location.none, sub.expr sub expr))
346349
| ( Asttypes.Noloc.Labelled name,
347350
{
348351
pexp_desc = Pexp_ident {txt = Longident.Lident v};

compiler/ml/ast_mapper_to0.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,8 @@ module E = struct
471471
else Asttypes.Noloc.Labelled name.txt
472472
in
473473
(label, sub.expr sub value)
474-
| _ -> failwith "todo")
474+
| JSXPropSpreading (_, value) ->
475+
(Asttypes.Noloc.Labelled "_spreadProps", sub.expr sub value))
475476
in
476477
let children_expr =
477478
let loc =

0 commit comments

Comments
 (0)