aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-01-28 02:04:44 +0800
committerGitHub <noreply@github.com>2020-01-28 02:04:44 +0800
commit0dcedad2d5a6b670ecd5aef3cf18d5e511af6e91 (patch)
tree4ebdc0ef0fa3e9590377ddc20c54e01086ff9a3e /lib
parent36a430cd1e4a838602adace6f3321496992687c6 (diff)
downloadtracifyjs-0dcedad2d5a6b670ecd5aef3cf18d5e511af6e91.tar.gz
tracifyjs-0dcedad2d5a6b670ecd5aef3cf18d5e511af6e91.zip
fix corner case in `booleans` (#3691)
fixes #3690
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/compress.js b/lib/compress.js
index a3baa7b1..4e967aef 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -4453,7 +4453,7 @@ merge(Compressor.prototype, {
var ev = value.is_truthy() || value.tail_node().evaluate(compressor);
if (!ev) {
value = value.drop_side_effect_free(compressor);
- if (node.value !== value) node.value = value ? make_sequence(node.value, [
+ node.value = value ? make_sequence(node.value, [
value,
make_node(AST_Number, node.value, {
value: 0
@@ -4461,7 +4461,7 @@ merge(Compressor.prototype, {
]) : null;
} else if (ev && !(ev instanceof AST_Node)) {
value = value.drop_side_effect_free(compressor);
- if (node.value !== value) node.value = value ? make_sequence(node.value, [
+ node.value = value ? make_sequence(node.value, [
value,
make_node(AST_Number, node.value, {
value: 1