terser 5.9.0 → 5.12.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 +23 -0
- package/README.md +30 -8
- package/dist/bundle.min.js +252 -68
- package/lib/ast.js +5 -3
- package/lib/cli.js +13 -9
- package/lib/compress/index.js +35 -14
- package/lib/compress/native-objects.js +1 -0
- package/lib/minify.js +49 -1
- package/lib/mozilla-ast.js +48 -6
- package/lib/output.js +73 -23
- package/lib/parse.js +24 -8
- package/lib/scope.js +5 -4
- package/package.json +5 -3
package/lib/scope.js
CHANGED
@@ -781,6 +781,8 @@ AST_Toplevel.DEFMETHOD("mangle_names", function(options) {
|
|
781
781
|
}
|
782
782
|
|
783
783
|
const mangled_names = this.mangled_names = new Set();
|
784
|
+
unmangleable_names = new Set();
|
785
|
+
|
784
786
|
if (options.cache) {
|
785
787
|
this.globals.forEach(collect);
|
786
788
|
if (options.cache.props) {
|
@@ -833,7 +835,6 @@ AST_Toplevel.DEFMETHOD("mangle_names", function(options) {
|
|
833
835
|
this.walk(tw);
|
834
836
|
|
835
837
|
if (options.keep_fnames || options.keep_classnames) {
|
836
|
-
unmangleable_names = new Set();
|
837
838
|
// Collect a set of short names which are unmangleable,
|
838
839
|
// for use in avoiding collisions in next_mangled.
|
839
840
|
to_mangle.forEach(def => {
|
@@ -849,9 +850,9 @@ AST_Toplevel.DEFMETHOD("mangle_names", function(options) {
|
|
849
850
|
unmangleable_names = null;
|
850
851
|
|
851
852
|
function collect(symbol) {
|
852
|
-
|
853
|
-
|
854
|
-
if (
|
853
|
+
if (symbol.export & MASK_EXPORT_DONT_MANGLE) {
|
854
|
+
unmangleable_names.add(symbol.name);
|
855
|
+
} else if (!options.reserved.has(symbol.name)) {
|
855
856
|
to_mangle.push(symbol);
|
856
857
|
}
|
857
858
|
}
|
package/package.json
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
"homepage": "https://terser.org",
|
5
5
|
"author": "Mihai Bazon <mihai.bazon@gmail.com> (http://lisperator.net/)",
|
6
6
|
"license": "BSD-2-Clause",
|
7
|
-
"version": "5.
|
7
|
+
"version": "5.12.0",
|
8
8
|
"engines": {
|
9
9
|
"node": ">=10"
|
10
10
|
},
|
@@ -43,18 +43,18 @@
|
|
43
43
|
"main.js"
|
44
44
|
],
|
45
45
|
"dependencies": {
|
46
|
+
"acorn": "^8.5.0",
|
46
47
|
"commander": "^2.20.0",
|
47
48
|
"source-map": "~0.7.2",
|
48
49
|
"source-map-support": "~0.5.20"
|
49
50
|
},
|
50
51
|
"devDependencies": {
|
51
52
|
"@ls-lint/ls-lint": "^1.10.0",
|
52
|
-
"acorn": "^8.5.0",
|
53
53
|
"astring": "^1.7.5",
|
54
54
|
"eslint": "^7.32.0",
|
55
55
|
"eslump": "^3.0.0",
|
56
56
|
"esm": "^3.2.25",
|
57
|
-
"mocha": "^9.
|
57
|
+
"mocha": "^9.2.0",
|
58
58
|
"pre-commit": "^1.2.2",
|
59
59
|
"rimraf": "^3.0.2",
|
60
60
|
"rollup": "2.56.3",
|
@@ -104,6 +104,8 @@
|
|
104
104
|
"describe": false,
|
105
105
|
"it": false,
|
106
106
|
"require": false,
|
107
|
+
"before": false,
|
108
|
+
"after": false,
|
107
109
|
"global": false,
|
108
110
|
"process": false
|
109
111
|
},
|