Skip to content

Commit

Permalink
fix(es/minifier): Fix cargo feature debug (#10090)
Browse files Browse the repository at this point in the history
**Description:**

This PR fixes the `debug` feature of `swc_ecma_minifier`.
  • Loading branch information
kdy1 authored Feb 25, 2025
1 parent 1019f64 commit 48f68db
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions crates/swc_ecma_minifier/src/compress/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ impl Compressor<'_> {

#[cfg(feature = "debug")]
let start = {
let start = n.dump();
let start = force_dump_program(n);
debug!("===== Start =====\n{}", start);
start
};
Expand All @@ -180,7 +180,7 @@ impl Compressor<'_> {
let start_time = now();

#[cfg(feature = "debug")]
let start = n.dump();
let start = force_dump_program(n);

let mut visitor = expr_simplifier(self.marks.unresolved_mark, ExprSimplifierConfig {});
n.visit_mut_with(&mut visitor);
Expand All @@ -192,7 +192,7 @@ impl Compressor<'_> {
{
debug!(
"===== Simplified =====\n{start}===== ===== ===== =====\n{}",
n.dump()
force_dump_program(n)
);
}
}
Expand All @@ -209,7 +209,7 @@ impl Compressor<'_> {

#[cfg(feature = "debug")]
if !visitor.changed() {
let simplified = n.dump();
let simplified = force_dump_program(n);
if start != simplified {
assert_eq!(
DebugUsingDisplay(&start),
Expand Down Expand Up @@ -240,7 +240,7 @@ impl Compressor<'_> {

#[cfg(feature = "debug")]
if visitor.changed() {
let src = n.dump();
let src = force_dump_program(n);
debug!(
"===== Before pure =====\n{}\n===== After pure =====\n{}",
start, src
Expand Down

0 comments on commit 48f68db

Please sign in to comment.