terser 3.10.7 → 3.10.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of terser might be problematic. Click here for more details.

package/lib/compress.js CHANGED
@@ -4174,8 +4174,22 @@ merge(Compressor.prototype, {
4174
4174
  }
4175
4175
  }
4176
4176
 
4177
+ function use_increment(self) {
4178
+ if (self.step instanceof AST_Assign
4179
+ && self.step.operator === "+="
4180
+ && self.step.left instanceof AST_Symbol
4181
+ && self.step.right.print_to_string() === "1"
4182
+ ) {
4183
+ self.step = make_node(AST_UnaryPrefix, self.step, {
4184
+ operator: "++",
4185
+ expression: self.step.left
4186
+ });
4187
+ }
4188
+ }
4189
+
4177
4190
  OPT(AST_For, function(self, compressor) {
4178
4191
  if (!compressor.option("loops")) return self;
4192
+ use_increment(self);
4179
4193
  if (compressor.option("side_effects") && self.init) {
4180
4194
  self.init = self.init.drop_side_effect_free(compressor);
4181
4195
  }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "homepage": "https://github.com/fabiosantoscode/terser",
5
5
  "author": "Mihai Bazon <mihai.bazon@gmail.com> (http://lisperator.net/)",
6
6
  "license": "BSD-2-Clause",
7
- "version": "3.10.7",
7
+ "version": "3.10.8",
8
8
  "engines": {
9
9
  "node": ">=0.8.0"
10
10
  },
File without changes