aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2019-04-29 17:23:00 +0800
committerGitHub <noreply@github.com>2019-04-29 17:23:00 +0800
commitc37a8e927e5fdd2276c658586003710e119293c8 (patch)
treefa94faa28fe078006df3cdd44346c59358f41c00 /lib
parent413bbe0480d28d18833fbc3ebdb68fa74138d758 (diff)
downloadtracifyjs-c37a8e927e5fdd2276c658586003710e119293c8.tar.gz
tracifyjs-c37a8e927e5fdd2276c658586003710e119293c8.zip
fix corner case in `properties` (#3390)
fixes #3389
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 1a1b64f9..7d9a74d3 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -6067,7 +6067,7 @@ merge(Compressor.prototype, {
}
}
var parent = compressor.parent();
- if (compressor.option("reduce_vars") && is_lhs(self, parent) !== self) {
+ if (compressor.option("reduce_vars") && is_lhs(compressor.self(), parent) !== compressor.self()) {
var def = self.definition();
var fixed = self.fixed_value();
var single_use = def.single_use && !(parent instanceof AST_Call && parent.is_expr_pure(compressor));
@@ -6689,7 +6689,7 @@ merge(Compressor.prototype, {
return sym;
}
}
- if (is_lhs(self, compressor.parent())) return self;
+ if (is_lhs(compressor.self(), compressor.parent())) return self;
if (key !== prop) {
var sub = self.flatten_object(property, compressor);
if (sub) {
@@ -6787,7 +6787,7 @@ merge(Compressor.prototype, {
col: self.start.col
});
}
- if (is_lhs(self, compressor.parent())) return self;
+ if (is_lhs(compressor.self(), compressor.parent())) return self;
if (compressor.option("unsafe_proto")
&& self.expression instanceof AST_Dot
&& self.expression.property == "prototype") {