Comparing version 5.21.0 to 5.22.0
# Changelog | ||
## v5.20.1 | ||
## v5.22.0 | ||
- Do not `unsafe`ly shorten expressions like a?.toString() when they're conditional. | ||
- Avoid running drop_unused in nodes that aren't scopes. Fixes a rare crash. | ||
- When 'module' is enabled, assume strict mode when figuring out scopes. | ||
## v5.21.0 | ||
- Do not inline functions that would be retained in the toplevel (as this would cause code duplication). | ||
@@ -5,0 +10,0 @@ - Fix precedence of arrow function and ternary operator when formatting output. |
@@ -112,2 +112,4 @@ /*********************************************************************** | ||
if (compressor.has_directive("use asm")) return; | ||
if (!this.variables) return; // not really a scope (eg: AST_Class) | ||
var self = this; | ||
@@ -114,0 +116,0 @@ if (self.pinned()) return; |
@@ -208,2 +208,3 @@ /*********************************************************************** | ||
safari10: false, | ||
module: false, | ||
}); | ||
@@ -376,2 +377,7 @@ | ||
}); | ||
if (options.module) { | ||
tw.directives["use strict"] = true; | ||
} | ||
this.walk(tw); | ||
@@ -378,0 +384,0 @@ |
@@ -92,3 +92,3 @@ import { | ||
AST_Node.prototype.size = function (compressor, stack) { | ||
mangle_options = compressor && compressor.mangle_options; | ||
mangle_options = compressor && compressor._mangle_options; | ||
@@ -95,0 +95,0 @@ let size = 0; |
@@ -7,3 +7,3 @@ { | ||
"license": "BSD-2-Clause", | ||
"version": "5.21.0", | ||
"version": "5.22.0", | ||
"engines": { | ||
@@ -10,0 +10,0 @@ "node": ">=10" |
@@ -157,3 +157,4 @@ <h1><img src="https://terser.org/img/terser-banner-logo.png" alt="Terser" width="400"></h1> | ||
--module Input is an ES6 module. If `compress` or `mangle` is | ||
enabled then the `toplevel` option will be enabled. | ||
enabled then the `toplevel` option, as well as strict mode, | ||
will be enabled. | ||
--name-cache <file> File to hold mangled name mappings. | ||
@@ -916,3 +917,3 @@ --safari10 Support non-standard Safari 10/11. | ||
- `module` (default `false`) -- Pass `true` an ES6 modules, where the toplevel | ||
scope is not the global scope. Implies `toplevel`. | ||
scope is not the global scope. Implies `toplevel` and assumes input code is strict mode JS. | ||
@@ -919,0 +920,0 @@ - `nth_identifier` (default: an internal mangler that weights based on character |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2116613
60219
1417