From 1d72bbe96ca41a66f1ad1c32c6f5adcb155bd0f0 Mon Sep 17 00:00:00 2001 From: Dylan Conway <35280289+dylan-conway@users.noreply.github.com> Date: Tue, 9 May 2023 20:27:20 -0700 Subject: space before label (#2837) --- src/js_printer.zig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/js_printer.zig b/src/js_printer.zig index 9e2d0ad0c..dc4061c1a 100644 --- a/src/js_printer.zig +++ b/src/js_printer.zig @@ -4062,7 +4062,11 @@ fn NewPrinter( p.printBody(s.body); }, .s_label => |s| { - p.printIndent(); + if (!p.options.minify_whitespace and p.options.indent > 0) { + p.addSourceMapping(stmt.loc); + p.printIndent(); + } + p.printSpaceBeforeIdentifier(); p.printSymbol(s.name.ref orelse Global.panic("Internal error: expected label to have a name {any}", .{s})); p.print(":"); p.printBody(s.stmt); -- cgit v1.2.3