Skip to content

Commit

Permalink
fix(minifier): remove incorrect fold `Expression::AssignmentExpressio…
Browse files Browse the repository at this point in the history
…n` (#8211)
  • Loading branch information
Boshen committed Jan 1, 2025
1 parent 4ae15df commit 05be1fc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
7 changes: 0 additions & 7 deletions crates/oxc_ecmascript/src/constant_evaluation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,6 @@ pub trait ConstantEvaluation<'a> {
_ => None,
}
}
Expression::AssignmentExpression(assign_expr) => {
match assign_expr.operator {
AssignmentOperator::LogicalAnd | AssignmentOperator::LogicalOr => None,
// For ASSIGN, the value is the value of the RHS.
_ => self.get_boolean_value(&assign_expr.right),
}
}
expr => {
use crate::ToBoolean;
expr.to_boolean()
Expand Down
4 changes: 2 additions & 2 deletions tasks/minsize/minsize.snap
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ Original | minified | minified | gzip | gzip | Fixture

544.10 kB | 71.84 kB | 72.48 kB | 26.19 kB | 26.20 kB | lodash.js

555.77 kB | 273.48 kB | 270.13 kB | 90.94 kB | 90.80 kB | d3.js
555.77 kB | 273.58 kB | 270.13 kB | 90.98 kB | 90.80 kB | d3.js

1.01 MB | 460.75 kB | 458.89 kB | 126.88 kB | 126.71 kB | bundle.min.js

1.25 MB | 653.17 kB | 646.76 kB | 163.58 kB | 163.73 kB | three.js

2.14 MB | 726.71 kB | 724.14 kB | 180.25 kB | 181.07 kB | victory.js

3.20 MB | 1.01 MB | 1.01 MB | 332.13 kB | 331.56 kB | echarts.js
3.20 MB | 1.01 MB | 1.01 MB | 332.14 kB | 331.56 kB | echarts.js

6.69 MB | 2.32 MB | 2.31 MB | 493.00 kB | 488.28 kB | antd.js

Expand Down

0 comments on commit 05be1fc

Please sign in to comment.