diff --git a/crates/oxc_codegen/src/gen.rs b/crates/oxc_codegen/src/gen.rs index 57bc3efb7cd75..d0ab1eb340c6b 100644 --- a/crates/oxc_codegen/src/gen.rs +++ b/crates/oxc_codegen/src/gen.rs @@ -534,7 +534,6 @@ impl Gen for SwitchStatement<'_> { p.print_soft_space(); p.print_curly_braces(self.span, self.cases.is_empty(), |p| { for case in &self.cases { - p.add_source_mapping(case.span); case.print(p, ctx); } }); @@ -547,9 +546,11 @@ impl Gen for SwitchCase<'_> { fn gen(&self, p: &mut Codegen, ctx: Context) { p.print_semicolon_if_needed(); p.print_indent(); + p.add_source_mapping(self.span); match &self.test { Some(test) => { - p.print_str("case "); + p.print_str("case"); + p.print_soft_space(); p.print_expression(test); } None => p.print_str("default"), diff --git a/tasks/minsize/minsize.snap b/tasks/minsize/minsize.snap index 85b5bc50b1097..d1d640a2b34bd 100644 --- a/tasks/minsize/minsize.snap +++ b/tasks/minsize/minsize.snap @@ -3,23 +3,23 @@ Original | minified | minified | gzip | gzip | Fixture ------------------------------------------------------------------------------------- 72.14 kB | 24.04 kB | 23.70 kB | 8.61 kB | 8.54 kB | react.development.js -173.90 kB | 61.60 kB | 59.82 kB | 19.54 kB | 19.33 kB | moment.js +173.90 kB | 61.55 kB | 59.82 kB | 19.54 kB | 19.33 kB | moment.js 287.63 kB | 92.60 kB | 90.07 kB | 32.27 kB | 31.95 kB | jquery.js -342.15 kB | 121.56 kB | 118.14 kB | 44.64 kB | 44.37 kB | vue.js +342.15 kB | 121.55 kB | 118.14 kB | 44.64 kB | 44.37 kB | vue.js 544.10 kB | 73.32 kB | 72.48 kB | 26.13 kB | 26.20 kB | lodash.js -555.77 kB | 276.08 kB | 270.13 kB | 91.14 kB | 90.80 kB | d3.js +555.77 kB | 276.06 kB | 270.13 kB | 91.14 kB | 90.80 kB | d3.js -1.01 MB | 467.00 kB | 458.89 kB | 126.74 kB | 126.71 kB | bundle.min.js +1.01 MB | 466.83 kB | 458.89 kB | 126.74 kB | 126.71 kB | bundle.min.js -1.25 MB | 661.60 kB | 646.76 kB | 163.94 kB | 163.73 kB | three.js +1.25 MB | 661.47 kB | 646.76 kB | 163.94 kB | 163.73 kB | three.js -2.14 MB | 740.48 kB | 724.14 kB | 181.35 kB | 181.07 kB | victory.js +2.14 MB | 740.44 kB | 724.14 kB | 181.35 kB | 181.07 kB | victory.js -3.20 MB | 1.02 MB | 1.01 MB | 332.01 kB | 331.56 kB | echarts.js +3.20 MB | 1.02 MB | 1.01 MB | 332.00 kB | 331.56 kB | echarts.js 6.69 MB | 2.39 MB | 2.31 MB | 495.62 kB | 488.28 kB | antd.js