Skip to content

Commit

Permalink
fix: inline variable aliases (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
j4k0xb committed Oct 2, 2024
1 parent 4ecd7e9 commit f551d5e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/webcrack/src/ast-utils/inline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ export function inlineVariableAliases(
ref.parentPath.remove();
} else {
// Replace `(alias = decoder)(1);` with `decoder(1);`
ref.parentPath.replaceWith(ref.parentPath.node.right);
ref.parentPath.replaceWith(t.identifier(targetName));
}
} else if (ref.parentPath?.isVariableDeclarator()) {
// Remove `alias = decoder;` of declarator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ decoder(1);
decoder(2);
decoder(3);
() => {
alias(4);
decoder(4);
};
decoder(5);
};"
Expand Down

0 comments on commit f551d5e

Please sign in to comment.