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/dist/bundle.js +7 -0
- package/dist/bundle.js.map +1 -1
- package/lib/compress.js +14 -0
- package/package.json +1 -1
- package/dist/.coverage.lock +0 -0
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
package/dist/.coverage.lock
DELETED
File without changes
|