terser 5.31.2 → 5.31.3
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 +3 -0
- package/dist/bundle.min.js +9 -3
- package/lib/compress/drop-unused.js +8 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## v5.31.3
|
4
|
+
- drop_unused: drop unused parameters from IIFEs in some more situations.
|
5
|
+
|
3
6
|
## v5.31.2
|
4
7
|
- drop_unused: scan variables in self-referential class declarations that contain side effects.
|
5
8
|
- Don't add parens to arrow function when it's the default for an argument (#1540)
|
package/dist/bundle.min.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@jridgewell/source-map')) :
|
3
3
|
typeof define === 'function' && define.amd ? define(['exports', '@jridgewell/source-map'], factory) :
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Terser = {}, global.sourceMap));
|
5
|
-
}(this, (function (exports, sourceMap) { 'use strict';
|
5
|
+
})(this, (function (exports, sourceMap) { 'use strict';
|
6
6
|
|
7
7
|
/***********************************************************************
|
8
8
|
|
@@ -15391,7 +15391,13 @@ AST_Scope.DEFMETHOD("drop_unused", function(compressor) {
|
|
15391
15391
|
if (!in_use_ids.has(def.id) || def.orig.length > 1) node.name = null;
|
15392
15392
|
}
|
15393
15393
|
if (node instanceof AST_Lambda && !(node instanceof AST_Accessor)) {
|
15394
|
-
var trim =
|
15394
|
+
var trim =
|
15395
|
+
!compressor.option("keep_fargs")
|
15396
|
+
// Is this an IIFE that won't refer to its name?
|
15397
|
+
|| parent instanceof AST_Call
|
15398
|
+
&& parent.expression === node
|
15399
|
+
&& !node.pinned()
|
15400
|
+
&& (!node.name || node.name.unreferenced());
|
15395
15401
|
for (var a = node.argnames, i = a.length; --i >= 0;) {
|
15396
15402
|
var sym = a[i];
|
15397
15403
|
if (sym instanceof AST_Expansion) {
|
@@ -32541,4 +32547,4 @@ exports._run_cli = run_cli;
|
|
32541
32547
|
exports.minify = minify;
|
32542
32548
|
exports.minify_sync = minify_sync;
|
32543
32549
|
|
32544
|
-
}))
|
32550
|
+
}));
|
@@ -45,6 +45,7 @@ import {
|
|
45
45
|
AST_Accessor,
|
46
46
|
AST_Assign,
|
47
47
|
AST_BlockStatement,
|
48
|
+
AST_Call,
|
48
49
|
AST_Class,
|
49
50
|
AST_ClassExpression,
|
50
51
|
AST_ClassStaticBlock,
|
@@ -256,7 +257,13 @@ AST_Scope.DEFMETHOD("drop_unused", function(compressor) {
|
|
256
257
|
if (!in_use_ids.has(def.id) || def.orig.length > 1) node.name = null;
|
257
258
|
}
|
258
259
|
if (node instanceof AST_Lambda && !(node instanceof AST_Accessor)) {
|
259
|
-
var trim =
|
260
|
+
var trim =
|
261
|
+
!compressor.option("keep_fargs")
|
262
|
+
// Is this an IIFE that won't refer to its name?
|
263
|
+
|| parent instanceof AST_Call
|
264
|
+
&& parent.expression === node
|
265
|
+
&& !node.pinned()
|
266
|
+
&& (!node.name || node.name.unreferenced());
|
260
267
|
for (var a = node.argnames, i = a.length; --i >= 0;) {
|
261
268
|
var sym = a[i];
|
262
269
|
if (sym instanceof AST_Expansion) {
|