Skip to content

Commit

Permalink
fixup! Add location after return statement
Browse files Browse the repository at this point in the history
  • Loading branch information
vouillon committed Oct 21, 2024
1 parent c9488bb commit 65116cd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion compiler/lib/js_traverse.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1754,7 +1754,10 @@ class simpl =
, (Return_statement (Some e1, _), _)
, Some (Return_statement (Some e2, _), _) ) ->
( Return_statement
(Some (ECond (cond, e1, e2)), U (*ZZZ Use end of function? *))
( Some (ECond (cond, e1, e2))
, U
(*TODO: it would be better to use the location of the
end of the function, but we can't easily get it. *) )
, loc )
:: rem
(* if (e1) v1 = e2 else v1 = e3 --> v1 = e1 ? e2 : e3 *)
Expand Down

0 comments on commit 65116cd

Please sign in to comment.