Skip to content

Commit c6044f4

Browse files
committed
fix wrong inlining
1 parent 07fa877 commit c6044f4

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

jscomp/core/js_dump.ml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -603,19 +603,14 @@ and expression_desc cxt ~(level : int) f x : cxt =
603603
P.string f "`";
604604
let rec aux cxt xs ys = match xs, ys with
605605
| [], [] -> ()
606-
| x_head :: x_rest, ys ->
607-
let cxt = (match x_head with
608-
| {J.expression_desc = Str { txt; _ }} ->
606+
| [{J.expression_desc = Str { txt; _ }}], [] ->
607+
P.string f txt
608+
| {J.expression_desc = Str { txt; _ }} :: x_rest, y :: y_rest ->
609609
P.string f txt;
610-
cxt
611-
| _ ->
612610
P.string f "${";
613-
let cxt = expression cxt ~level f x_head in
611+
let cxt = expression cxt ~level f y in
614612
P.string f "}";
615-
cxt
616-
)
617-
in
618-
aux cxt ys x_rest
613+
aux cxt x_rest y_rest
619614
| _ -> assert false
620615
in
621616
aux cxt stringArgs valueArgs;

jscomp/test/tagged_template_test.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)