terser 5.2.1 → 5.3.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 +6 -0
- package/LICENSE +1 -1
- package/README.md +1 -1
- package/dist/bundle.min.js +2159 -4
- package/dist/bundle.min.js.map +1 -1
- package/lib/compress/index.js +7 -3
- package/package.json +1 -1
- package/tools/domprops.js +2152 -1
package/lib/compress/index.js
CHANGED
@@ -3091,7 +3091,8 @@ var static_fns = convert_to_predicate({
|
|
3091
3091
|
return this;
|
3092
3092
|
});
|
3093
3093
|
def_eval(AST_Chain, function(compressor, depth) {
|
3094
|
-
|
3094
|
+
const evaluated = this.expression._eval(compressor, depth);
|
3095
|
+
return evaluated === this.expression ? this : evaluated;
|
3095
3096
|
});
|
3096
3097
|
def_eval(AST_Call, function(compressor, depth) {
|
3097
3098
|
var exp = this.expression;
|
@@ -4259,7 +4260,9 @@ AST_Scope.DEFMETHOD("hoist_properties", function(compressor) {
|
|
4259
4260
|
&& !top_retain(def)
|
4260
4261
|
&& (value = sym.fixed_value()) === node.value
|
4261
4262
|
&& value instanceof AST_Object
|
4262
|
-
&& !value.properties.some(prop =>
|
4263
|
+
&& !value.properties.some(prop =>
|
4264
|
+
prop instanceof AST_Expansion || prop.computed_key()
|
4265
|
+
)
|
4263
4266
|
) {
|
4264
4267
|
descend(node, this);
|
4265
4268
|
const defs = new Map();
|
@@ -6378,7 +6381,8 @@ def_optimize(AST_SymbolRef, function(self, compressor) {
|
|
6378
6381
|
let single_use = def.single_use
|
6379
6382
|
&& !(parent instanceof AST_Call
|
6380
6383
|
&& (parent.is_expr_pure(compressor))
|
6381
|
-
|| has_annotation(parent, _NOINLINE))
|
6384
|
+
|| has_annotation(parent, _NOINLINE))
|
6385
|
+
&& !(fixed instanceof AST_Defun && parent instanceof AST_Export);
|
6382
6386
|
|
6383
6387
|
if (single_use && (fixed instanceof AST_Lambda || fixed instanceof AST_Class)) {
|
6384
6388
|
if (retain_top_func(fixed, compressor)) {
|