terser 4.6.11 → 4.8.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.
Potentially problematic release.
This version of terser might be problematic. Click here for more details.
- package/CHANGELOG.md +22 -0
- package/README.md +6 -9
- package/bin/terser +1 -0
- package/dist/bundle.min.js +1 -1
- package/dist/bundle.min.js.map +1 -1
- package/package.json +2 -2
- package/tools/postinstall.js +0 -7
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,27 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## v4.8.0
|
4
|
+
|
5
|
+
- Support for numeric separators (`million = 1_000_000`) was added.
|
6
|
+
- Assigning properties to a class is now assumed to be pure.
|
7
|
+
- Fixed bug where `yield` wasn't considered a valid property key in generators.
|
8
|
+
|
9
|
+
## v4.7.0
|
10
|
+
|
11
|
+
- A bug was fixed where an arrow function would have the wrong size
|
12
|
+
- `arguments` object is now considered safe to retrieve properties from (useful for `length`, or `0`) even when `pure_getters` is not set.
|
13
|
+
- Fixed erroneous `const` declarations without value (which is invalid) in some corner cases when using `collapse_vars`.
|
14
|
+
|
15
|
+
## v4.6.13
|
16
|
+
|
17
|
+
- Fixed issue where ES5 object properties were being turned into ES6 object properties due to more lax unicode rules.
|
18
|
+
- Fixed parsing of BigInt with lowercase `e` in them.
|
19
|
+
|
20
|
+
## v4.6.12
|
21
|
+
|
22
|
+
- Fixed subtree comparison code, making it see that `[1,[2, 3]]` is different from `[1, 2, [3]]`
|
23
|
+
- Printing of unicode identifiers has been improved
|
24
|
+
|
3
25
|
## v4.6.11
|
4
26
|
|
5
27
|
- Read unused classes' properties and method keys, to figure out if they use other variables.
|
package/README.md
CHANGED
@@ -90,10 +90,9 @@ a double dash to prevent input files being used as option arguments:
|
|
90
90
|
`reserved` List of names that should not be mangled.
|
91
91
|
--mangle-props [options] Mangle properties/specify mangler options:
|
92
92
|
`builtins` Mangle property names that overlaps
|
93
|
-
with standard JavaScript globals
|
93
|
+
with standard JavaScript globals and DOM
|
94
|
+
API props.
|
94
95
|
`debug` Add debug prefix and suffix.
|
95
|
-
`domprops` Mangle property names that overlaps
|
96
|
-
with DOM properties.
|
97
96
|
`keep_quoted` Only mangle unquoted properties, quoted
|
98
97
|
properties are automatically reserved.
|
99
98
|
`strict` disables quoted properties
|
@@ -321,12 +320,8 @@ $ terser example.js -c passes=2 -m --mangle-props regex=/_$/,reserved=[bar_]
|
|
321
320
|
var x={o:3,t:1,calc:function(){return this.t+this.o},bar_:2};console.log(x.calc());
|
322
321
|
```
|
323
322
|
|
324
|
-
In order for this to be of any use, we avoid mangling standard JS names
|
325
|
-
default (`--mangle-props builtins` to override).
|
326
|
-
|
327
|
-
A default exclusion file is provided in `tools/domprops.js` which should
|
328
|
-
cover most standard JS and DOM properties defined in various browsers. Pass
|
329
|
-
`--mangle-props domprops` to disable this feature.
|
323
|
+
In order for this to be of any use, we avoid mangling standard JS names and DOM
|
324
|
+
API properties by default (`--mangle-props builtins` to override).
|
330
325
|
|
331
326
|
A regular expression can be used to define which property names should be
|
332
327
|
mangled. For example, `--mangle-props regex=/^_/` will only mangle property
|
@@ -1321,6 +1316,8 @@ To allow for better optimizations, the compiler makes various assumptions:
|
|
1321
1316
|
- Object properties can be added, removed and modified (not prevented with
|
1322
1317
|
`Object.defineProperty()`, `Object.defineProperties()`, `Object.freeze()`,
|
1323
1318
|
`Object.preventExtensions()` or `Object.seal()`).
|
1319
|
+
- `document.all` is not `== null`
|
1320
|
+
- Assigning properties to a class doesn't have side effects and does not throw.
|
1324
1321
|
|
1325
1322
|
### Build Tools and Adaptors using Terser
|
1326
1323
|
|