mirror of
https://github.com/swc-project/swc.git
synced 2024-11-28 02:29:04 +03:00
fix(es/minifier): Remove wrong code (#5485)
This commit is contained in:
parent
bcc67c39b0
commit
2045fe6273
10
crates/swc/tests/exec/next/39412/exec.js
Normal file
10
crates/swc/tests/exec/next/39412/exec.js
Normal file
@ -0,0 +1,10 @@
|
||||
const a = true;
|
||||
const b = true;
|
||||
const c = false;
|
||||
if (a && b && c) {
|
||||
console.log('This shouldn\'t log');
|
||||
}
|
||||
if (c && b && a) {
|
||||
console.log('Reversed: This also shouldn\'t log');
|
||||
}
|
||||
console.log('PASS')
|
@ -326,11 +326,6 @@ where
|
||||
report_change!("Optimizing: e && true => !!e");
|
||||
|
||||
self.negate_twice(&mut bin.left, false);
|
||||
*e = *bin.left.take();
|
||||
} else {
|
||||
self.changed = true;
|
||||
report_change!("Optimizing: e && false => e");
|
||||
|
||||
*e = *bin.left.take();
|
||||
}
|
||||
}
|
||||
|
@ -46,4 +46,4 @@ tracing = "0.1.32"
|
||||
|
||||
[dev-dependencies]
|
||||
pretty_assertions = "1.1"
|
||||
testing = { path = "../testing" }
|
||||
testing = { version = "0.29.4", path = "../testing" }
|
||||
|
Loading…
Reference in New Issue
Block a user