aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-02-15 13:04:44 +0000
committerGitHub <noreply@github.com>2020-02-15 13:04:44 +0000
commitf0a29902acc24217881529449c7f9b8815896297 (patch)
tree376a926f874380cee6c04d5b123c18f646e976bf /lib/compress.js
parent0d820e4c0a7a1b1eeee25fb632b9496a9780b28a (diff)
downloadtracifyjs-f0a29902acc24217881529449c7f9b8815896297.tar.gz
tracifyjs-f0a29902acc24217881529449c7f9b8815896297.zip
enhance `properties` (#3721)
Diffstat (limited to 'lib/compress.js')
-rw-r--r--lib/compress.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 666f4c4c..e8a71791 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -7615,9 +7615,11 @@ merge(Compressor.prototype, {
value = value.fixed_value();
}
if (!value) return false;
- return !(value instanceof AST_Lambda)
- || compressor.parent() instanceof AST_New
- || !value.contains_this();
+ if (!(value instanceof AST_Lambda)) return true;
+ var parent = compressor.parent();
+ if (parent.TYPE != "Call") return true;
+ if (parent.expression !== compressor.self()) return true;
+ return !value.contains_this();
}
OPT(AST_Sub, function(self, compressor) {