diff options
author | 2023-04-20 23:57:26 -0700 | |
---|---|---|
committer | 2023-04-20 23:57:44 -0700 | |
commit | 541d16f8bed5f51a9861419d7273e733dae56549 (patch) | |
tree | 835e524ed78722ffcfb80c5e4227992a704aa3dc /src/js_parser.zig | |
parent | b609f9be2894f5237a0d058eaea884f330f02f77 (diff) | |
download | bun-541d16f8bed5f51a9861419d7273e733dae56549.tar.gz bun-541d16f8bed5f51a9861419d7273e733dae56549.tar.zst bun-541d16f8bed5f51a9861419d7273e733dae56549.zip |
Fix bug with merging adjacent vars
Diffstat (limited to '')
-rw-r--r-- | src/js_parser.zig | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/js_parser.zig b/src/js_parser.zig index 34db0e5ac..cf78826ea 100644 --- a/src/js_parser.zig +++ b/src/js_parser.zig @@ -20154,7 +20154,9 @@ fn NewParser_( // Merge adjacent local statements if (output.items.len > 0) { var prev_stmt = &output.items[output.items.len - 1]; - if (prev_stmt.data == .s_local and local.kind == prev_stmt.data.s_local.kind and local.is_export == prev_stmt.data.s_local.is_export) { + if (prev_stmt.data == .s_local and + local.canMergeWith(prev_stmt.data.s_local)) + { prev_stmt.data.s_local.decls.append(p.allocator, local.decls.slice()) catch unreachable; continue; } |