diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2021-01-08 05:03:21 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-08 13:03:21 +0800 |
commit | 7fe8c9150ac68fb13716e465872ed9e15d7a5126 (patch) | |
tree | e43af5ae6f754bdeab9297b1f21b5b05a740fb4d /lib/compress.js | |
parent | 6c419bc083e097337960f1a19d2c352336d75e16 (diff) | |
download | tracifyjs-7fe8c9150ac68fb13716e465872ed9e15d7a5126.tar.gz tracifyjs-7fe8c9150ac68fb13716e465872ed9e15d7a5126.zip |
fix corner case in `assignments` (#4522)
fixes #4521
Diffstat (limited to 'lib/compress.js')
-rw-r--r-- | lib/compress.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/compress.js b/lib/compress.js index fd0564cb..bcffd8b8 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -9948,9 +9948,9 @@ merge(Compressor.prototype, { operator: self.right.operator + "=", left: self.left, right: self.right.right, - }).optimize(compressor); + }); } - else if (self.right.right instanceof AST_SymbolRef + if (self.right.right instanceof AST_SymbolRef && self.right.right.name == self.left.name && ASSIGN_OPS_COMMUTATIVE[self.right.operator] && !self.right.left.has_side_effects(compressor)) { @@ -9959,7 +9959,7 @@ merge(Compressor.prototype, { operator: self.right.operator + "=", left: self.left, right: self.right.left, - }).optimize(compressor); + }); } } if ((self.operator == "-=" || self.operator == "+=" |