Skip to content

Commit 9d5034e

Browse files
committed
avoid empty line in return undefined
1 parent 7172a6b commit 9d5034e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

jscomp/core/js_dump.ml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1212,6 +1212,8 @@ and function_body (cxt : cxt) f (b : J.block) : unit =
12121212
: cxt)
12131213
| Return { expression_desc = Undefined } -> ()
12141214
| _ -> ignore (statement false cxt f s : cxt))
1215+
| [ s; { statement_desc = Return { expression_desc = Undefined } } ] ->
1216+
ignore (statement false cxt f s : cxt)
12151217
| s :: r ->
12161218
let cxt = statement false cxt f s in
12171219
P.newline f;
@@ -1225,8 +1227,7 @@ and brace_block cxt f b =
12251227
and statements top cxt f b =
12261228
iter_lst cxt f b
12271229
(fun cxt f s -> statement top cxt f s)
1228-
(if top then P.at_least_two_lines
1229-
else P.newline)
1230+
(if top then P.at_least_two_lines else P.newline)
12301231

12311232
let string_of_block (block : J.block) =
12321233
let buffer = Buffer.create 50 in

0 commit comments

Comments
 (0)