terser 5.28.0 → 5.29.0
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.
- package/CHANGELOG.md +9 -0
- package/dist/bundle.min.js +20 -20
- package/lib/compress/index.js +19 -17
- package/lib/mozilla-ast.js +1 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## v5.29.0
|
4
|
+
- Re-releases previously reverted 5.28.0
|
5
|
+
- Fix crash while optimizing some bitwise ops
|
6
|
+
- (internal) Remove needless wrapper for from_moz (#1499)
|
7
|
+
|
8
|
+
## v5.28.1
|
9
|
+
(hotfix release)
|
10
|
+
- Reverts v5.28.0
|
11
|
+
|
3
12
|
## v5.28.0
|
4
13
|
- Optimise redundant or shrinkable bitwise operations (`|`, `^`, `&`, `>>`, `<<`)
|
5
14
|
- Evaluate some `BigInt` math operations
|
package/dist/bundle.min.js
CHANGED
@@ -7583,9 +7583,7 @@ def_transform(AST_PrefixedTemplateString, function(self, tw) {
|
|
7583
7583
|
start: my_start_token(M),
|
7584
7584
|
end: my_end_token(M),
|
7585
7585
|
exported_definition: from_moz(M.declaration),
|
7586
|
-
exported_names: M.specifiers && M.specifiers.length ? M.specifiers.map(
|
7587
|
-
return from_moz(specifier);
|
7588
|
-
}) : null,
|
7586
|
+
exported_names: M.specifiers && M.specifiers.length ? M.specifiers.map(from_moz) : null,
|
7589
7587
|
module_name: from_moz(M.source),
|
7590
7588
|
assert_clause: assert_clause_from_moz(M.assertions)
|
7591
7589
|
});
|
@@ -20952,24 +20950,26 @@ def_optimize(AST_Binary, function(self, compressor) {
|
|
20952
20950
|
y_node = self.right.left;
|
20953
20951
|
}
|
20954
20952
|
|
20955
|
-
if (
|
20956
|
-
|
20957
|
-
|
20958
|
-
|
20959
|
-
|
20960
|
-
|
20961
|
-
|
20962
|
-
|
20963
|
-
|
20964
|
-
|
20965
|
-
|
20966
|
-
|
20967
|
-
|
20968
|
-
|
20969
|
-
|
20970
|
-
|
20953
|
+
if (x_node && y_node) {
|
20954
|
+
if ((y & z) === 0) {
|
20955
|
+
self = make_node(AST_Binary, self, {
|
20956
|
+
operator: self.operator,
|
20957
|
+
left: z_node,
|
20958
|
+
right: x_node
|
20959
|
+
});
|
20960
|
+
} else {
|
20961
|
+
const reordered_ops = make_node(AST_Binary, self, {
|
20962
|
+
operator: "|",
|
20963
|
+
left: make_node(AST_Binary, self, {
|
20964
|
+
operator: "&",
|
20965
|
+
left: x_node,
|
20966
|
+
right: z_node
|
20967
|
+
}),
|
20968
|
+
right: make_node_from_constant(y & z, y_node),
|
20969
|
+
});
|
20971
20970
|
|
20972
|
-
|
20971
|
+
self = best_of(compressor, self, reordered_ops);
|
20972
|
+
}
|
20973
20973
|
}
|
20974
20974
|
}
|
20975
20975
|
|
package/lib/compress/index.js
CHANGED
@@ -2711,24 +2711,26 @@ def_optimize(AST_Binary, function(self, compressor) {
|
|
2711
2711
|
y_node = self.right.left;
|
2712
2712
|
}
|
2713
2713
|
|
2714
|
-
if (
|
2715
|
-
|
2716
|
-
|
2717
|
-
|
2718
|
-
|
2719
|
-
|
2720
|
-
|
2721
|
-
|
2722
|
-
|
2723
|
-
|
2724
|
-
|
2725
|
-
|
2726
|
-
|
2727
|
-
|
2728
|
-
|
2729
|
-
|
2714
|
+
if (x_node && y_node) {
|
2715
|
+
if ((y & z) === 0) {
|
2716
|
+
self = make_node(AST_Binary, self, {
|
2717
|
+
operator: self.operator,
|
2718
|
+
left: z_node,
|
2719
|
+
right: x_node
|
2720
|
+
});
|
2721
|
+
} else {
|
2722
|
+
const reordered_ops = make_node(AST_Binary, self, {
|
2723
|
+
operator: "|",
|
2724
|
+
left: make_node(AST_Binary, self, {
|
2725
|
+
operator: "&",
|
2726
|
+
left: x_node,
|
2727
|
+
right: z_node
|
2728
|
+
}),
|
2729
|
+
right: make_node_from_constant(y & z, y_node),
|
2730
|
+
});
|
2730
2731
|
|
2731
|
-
|
2732
|
+
self = best_of(compressor, self, reordered_ops);
|
2733
|
+
}
|
2732
2734
|
}
|
2733
2735
|
}
|
2734
2736
|
|
package/lib/mozilla-ast.js
CHANGED
@@ -618,9 +618,7 @@ import { is_basic_identifier_string } from "./parse.js";
|
|
618
618
|
start: my_start_token(M),
|
619
619
|
end: my_end_token(M),
|
620
620
|
exported_definition: from_moz(M.declaration),
|
621
|
-
exported_names: M.specifiers && M.specifiers.length ? M.specifiers.map(
|
622
|
-
return from_moz(specifier);
|
623
|
-
}) : null,
|
621
|
+
exported_names: M.specifiers && M.specifiers.length ? M.specifiers.map(from_moz) : null,
|
624
622
|
module_name: from_moz(M.source),
|
625
623
|
assert_clause: assert_clause_from_moz(M.assertions)
|
626
624
|
});
|