terser 4.6.3 → 4.6.7

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 CHANGED
@@ -1,5 +1,33 @@
1
1
  # Changelog
2
2
 
3
+ ## v4.6.7
4
+
5
+ - Some new performance gains through a `AST_Node.size()` method which measures a node's source code length without printing it to a string first.
6
+ - An issue with setting `--comments` to `false` in the CLI has been fixed.
7
+ - Fixed some issues with inlining
8
+ - `unsafe_symbols` compress option was added, which turns `Symbol("name")` into just `Symbol()`
9
+ - Brought back compress performance improvement through the `AST_Node.equivalent_to(other)` method (which was reverted in v4.6.6).
10
+
11
+ ## v4.6.6
12
+
13
+ (hotfix release)
14
+
15
+ - Reverted code to 4.6.4 to allow for more time to investigate an issue.
16
+
17
+ ## v4.6.5 (REVERTED)
18
+
19
+ - Improved compress performance through using a new method to see if two nodes are equivalent, instead of printing them to a string.
20
+
21
+ ## v4.6.4
22
+
23
+ - The `"some"` value in the `comments` output option now preserves `@lic` and other important comments when using `//`
24
+ - `</script>` is now better escaped in regex, and in comments, when using the `inline_script` output option
25
+ - Fixed an issue when transforming `new RegExp` into `/.../` when slashes are included in the source
26
+ - `AST_Node.prototype.constructor` now exists, allowing for easier debugging of crashes
27
+ - Multiple if statements with the same consequents are now collapsed
28
+ - Typescript typings improvements
29
+ - Optimizations while looking for surrogate pairs in strings
30
+
3
31
  ## v4.6.3
4
32
 
5
33
  - Annotations such as `/*#__NOINLINE__*/` and `/*#__PURE__*/` may now be preserved using the `preserve_annotations` output option
package/README.md CHANGED
@@ -865,6 +865,9 @@ If you happen to need the source map as a raw object, set `sourceMap.asObject` t
865
865
  - `unsafe_math` (default: `false`) -- optimize numerical expressions like
866
866
  `2 * x * 3` into `6 * x`, which may give imprecise floating point results.
867
867
 
868
+ - `unsafe_symbols` (default: `false`) -- removes keys from native Symbol
869
+ declarations, e.g `Symbol("kDog")` becomes `Symbol()`.
870
+
868
871
  - `unsafe_methods` (default: false) -- Converts `{ m: function(){} }` to
869
872
  `{ m(){} }`. `ecma` must be set to `6` or greater to enable this transform.
870
873
  If `unsafe_methods` is a RegExp then key/value pairs with keys matching the
package/bin/terser CHANGED
@@ -99,7 +99,7 @@ if (program.beautify) {
99
99
  }
100
100
  if (program.comments) {
101
101
  if (typeof options.output != "object") options.output = {};
102
- options.output.comments = typeof program.comments == "string" ? program.comments : "some";
102
+ options.output.comments = typeof program.comments == "string" ? (program.comments == "false" ? false : program.comments) : "some";
103
103
  }
104
104
  if (program.define) {
105
105
  if (typeof options.compress != "object") options.compress = {};