diff options
author | 2023-04-17 17:16:47 -0700 | |
---|---|---|
committer | 2023-04-17 17:16:57 -0700 | |
commit | 3a63fe457d4046b9d325953c9050f0598711aa3d (patch) | |
tree | 19e714db8a49b422c80ee17d65f9e39858994df7 | |
parent | a17624942e834875287c2b8b35b45954e91a67c3 (diff) | |
download | bun-3a63fe457d4046b9d325953c9050f0598711aa3d.tar.gz bun-3a63fe457d4046b9d325953c9050f0598711aa3d.tar.zst bun-3a63fe457d4046b9d325953c9050f0598711aa3d.zip |
Fix DCE bug with `new Foo()` when pure without arguments
-rw-r--r-- | src/js_parser.zig | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/js_parser.zig b/src/js_parser.zig index a8de35869..e950be4f5 100644 --- a/src/js_parser.zig +++ b/src/js_parser.zig @@ -1725,8 +1725,16 @@ pub const SideEffects = enum(u1) { // can be removed. The annotation causes us to ignore the target. if (call.can_be_unwrapped_if_unused) { if (call.args.len > 0) { - return Expr.joinAllWithCommaCallback(call.args.slice(), @TypeOf(p), p, simpifyUnusedExpr, p.allocator); + return Expr.joinAllWithCommaCallback( + call.args.slice(), + @TypeOf(p), + p, + simpifyUnusedExpr, + p.allocator, + ); } + + return null; } }, else => {}, |