mirror of
https://github.com/swc-project/swc.git
synced 2024-12-23 13:51:19 +03:00
Fix 1 - (1 - 1)
(#418)
This commit is contained in:
parent
7715c2626b
commit
5a47c7a15c
@ -353,7 +353,7 @@ impl Fold<Expr> for Fixer {
|
||||
| e @ Expr::Cond(..)
|
||||
| e @ Expr::Arrow(..) => box e.wrap_with_paren(),
|
||||
Expr::Bin(BinExpr { op: op_of_rhs, .. }) => {
|
||||
if op_of_rhs.precedence() < expr.op.precedence() {
|
||||
if op_of_rhs.precedence() <= expr.op.precedence() {
|
||||
box expr.right.wrap_with_paren()
|
||||
} else {
|
||||
expr.right
|
||||
@ -826,4 +826,6 @@ var store = global[SHARED] || (global[SHARED] = {});
|
||||
"const myFilter = (arr, filter) => arr.filter(filter || ((x) => x));"
|
||||
);
|
||||
|
||||
identical!(issue_418, "const a = 1 - (1 - 1)");
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user