aboutsummaryrefslogtreecommitdiff
path: root/lib/minify.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-11-05 22:14:11 +0800
committerGitHub <noreply@github.com>2017-11-05 22:14:11 +0800
commit2c2fd89e343626f8d7dc83812a6476b0ab99b784 (patch)
tree6a42beb30791bb9c35c98c6643e6e45a2e6bcc79 /lib/minify.js
parentf46281e2b75a0cae0fbc591ba23c000d4106a07a (diff)
downloadtracifyjs-2c2fd89e343626f8d7dc83812a6476b0ab99b784.tar.gz
tracifyjs-2c2fd89e343626f8d7dc83812a6476b0ab99b784.zip
inline single-use functions that are not constant expressions (#2434)
fixes #2428
Diffstat (limited to 'lib/minify.js')
-rw-r--r--lib/minify.js10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/minify.js b/lib/minify.js
index 773e953a..f9d726bf 100644
--- a/lib/minify.js
+++ b/lib/minify.js
@@ -137,11 +137,9 @@ function minify(files, options) {
if (options.wrap) {
toplevel = toplevel.wrap_commonjs(options.wrap);
}
- if (timings) timings.scope1 = Date.now();
- if (options.compress) toplevel.figure_out_scope(options.mangle);
if (timings) timings.compress = Date.now();
if (options.compress) toplevel = new Compressor(options.compress).compress(toplevel);
- if (timings) timings.scope2 = Date.now();
+ if (timings) timings.scope = Date.now();
if (options.mangle) toplevel.figure_out_scope(options.mangle);
if (timings) timings.mangle = Date.now();
if (options.mangle) {
@@ -199,9 +197,9 @@ function minify(files, options) {
if (timings) {
timings.end = Date.now();
result.timings = {
- parse: 1e-3 * (timings.scope1 - timings.parse),
- scope: 1e-3 * (timings.compress - timings.scope1 + timings.mangle - timings.scope2),
- compress: 1e-3 * (timings.scope2 - timings.compress),
+ parse: 1e-3 * (timings.compress - timings.parse),
+ compress: 1e-3 * (timings.scope - timings.compress),
+ scope: 1e-3 * (timings.mangle - timings.scope),
mangle: 1e-3 * (timings.properties - timings.mangle),
properties: 1e-3 * (timings.output - timings.properties),
output: 1e-3 * (timings.end - timings.output),