enable hoist_props by default (#2492)
This commit is contained in:
@@ -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_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:
|
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`
|
`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,
|
works best with `mangle` enabled, the `compress` option `passes` set to `2` or higher,
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ function Compressor(options, false_by_default) {
|
|||||||
expression : false,
|
expression : false,
|
||||||
global_defs : {},
|
global_defs : {},
|
||||||
hoist_funs : !false_by_default,
|
hoist_funs : !false_by_default,
|
||||||
hoist_props : false,
|
hoist_props : !false_by_default,
|
||||||
hoist_vars : false,
|
hoist_vars : false,
|
||||||
ie8 : false,
|
ie8 : false,
|
||||||
if_return : !false_by_default,
|
if_return : !false_by_default,
|
||||||
|
|||||||
Reference in New Issue
Block a user