Skip to content

Commit

Permalink
fix(bundler): disable moving identifiers (#14033)
Browse files Browse the repository at this point in the history
  • Loading branch information
paperdave authored Sep 19, 2024
1 parent 181b872 commit 866a6d9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/js_ast.zig
Original file line number Diff line number Diff line change
Expand Up @@ -5737,7 +5737,10 @@ pub const Expr = struct {
/// outside of a module wrapper (__esm/__commonJS).
pub fn canBeMoved(data: Expr.Data) bool {
return switch (data) {
.e_identifier => |id| id.can_be_removed_if_unused,
// TODO: identifiers can be removed if unused, however code that
// moves expressions around sometimes does so incorrectly when
// doing destructures. test case: https://github.com/oven-sh/bun/issues/14027
// .e_identifier => |id| id.can_be_removed_if_unused,

.e_class => |class| class.canBeMoved(),

Expand Down

0 comments on commit 866a6d9

Please sign in to comment.