Skip to content

Commit

Permalink
add return conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
joongwon committed Jan 6, 2025
1 parent 6fc6117 commit 0d32416
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/js_syntax.ml
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,10 @@ let rec convert_stat_list (body : (Loc.t, Loc.t) Flow_ast.Statement.t list) :
| Labeled _ ->
(* TODO: handle labeled statement *)
(tail, tail_cpl)
| Return _ -> raise NotImplemented
| Return { argument = Some expr; _ } ->
let expr = convert_expr expr in
(expr, CDet CReturn)
| Return { argument = None; _ } -> (Const Unit, CDet CReturn)
| Switch _ -> raise NotImplemented
| Throw _ -> raise NotImplemented
| Try _ -> raise NotImplemented
Expand Down

0 comments on commit 0d32416

Please sign in to comment.