[Pkg-javascript-commits] [uglifyjs] 284/491: enable `hoist_props` by default (#2492)

Jonas Smedegaard dr at jones.dk
Wed Feb 14 19:51:44 UTC 2018


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag debian/3.3.10-1
in repository uglifyjs.

commit b80062c490178552f45fe66acfa04e6d9c3a6363
Author: Alex Lam S.L <alexlamsl at gmail.com>
Date:   Sun Nov 19 14:56:23 2017 +0800

    enable `hoist_props` by default (#2492)
---
 README.md       | 10 +++++-----
 lib/compress.js |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/README.md b/README.md
index 18fc1b1..e4380e2 100644
--- a/README.md
+++ b/README.md
@@ -632,7 +632,7 @@ If you're using the `X-SourceMap` header instead, you can just omit `sourceMap.u
 
 - `hoist_funs` (default: `true`) -- hoist function declarations
 
-- `hoist_props` (default: `false`) -- hoist properties from constant object and
+- `hoist_props` (default: `true`) -- hoist properties from constant object and
   array literals into regular variables subject to a set of constraints. For example:
   `var o={p:1, q:2}; f(o.p, o.q);` is converted to `f(1, 2);`. Note: `hoist_props`
   works best with `mangle` enabled, the `compress` option `passes` set to `2` or higher,
@@ -690,11 +690,11 @@ If you're using the `X-SourceMap` header instead, you can just omit `sourceMap.u
   `foo` is certain to not throw, i.e. not `null` or `undefined`.
 
 - `reduce_funcs` (default: `true`) -- Allows single-use functions to be
-  inlined as function expressions when permissible allowing further 
-  optimization.  Enabled by default.  Option depends on `reduce_vars` 
-  being enabled.  Some code runs faster in the Chrome V8 engine if this 
+  inlined as function expressions when permissible allowing further
+  optimization.  Enabled by default.  Option depends on `reduce_vars`
+  being enabled.  Some code runs faster in the Chrome V8 engine if this
   option is disabled.  Does not negatively impact other major browsers.
-  
+
 - `reduce_vars` (default: `true`) -- Improve optimization on variables assigned with and
   used as constant values.
 
diff --git a/lib/compress.js b/lib/compress.js
index 2577643..4727aad 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -60,7 +60,7 @@ function Compressor(options, false_by_default) {
         expression    : false,
         global_defs   : {},
         hoist_funs    : !false_by_default,
-        hoist_props   : false,
+        hoist_props   : !false_by_default,
         hoist_vars    : false,
         ie8           : false,
         if_return     : !false_by_default,

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/uglifyjs.git



More information about the Pkg-javascript-commits mailing list