- `cascade` -- small optimization for sequences, transform `x, x` into `x`
and `x = something(), x` into `x = something()`
-- `collapse_vars` -- default `false`. Collapse single-use `var` and `const`
- definitions when possible.
+- `collapse_vars` -- Collapse single-use `var` and `const` definitions
+ when possible.
-- `reduce_vars` -- default `false`. Improve optimization on variables assigned
- with and used as constant values.
+- `reduce_vars` -- Improve optimization on variables assigned with and
+ used as constant values.
- `warnings` -- display warnings when dropping unreachable code or unused
declarations etc.
}
if (drop_vars && node instanceof AST_Definitions && !(tt.parent() instanceof AST_ForIn)) {
var def = node.definitions.filter(function(def){
+ if (def.value) def.value = def.value.transform(tt);
if (def.name.definition().id in in_use_ids) return true;
var w = {
name : def.name.name,
if (compressor.option("unused")
&& def.references.length == 1
&& compressor.find_parent(AST_Scope) === def.scope) {
- if (!compressor.option("keep_fnames")
- && exp.name && exp.name.definition() === def) {
- exp.name = null;
- }
self.expression = exp;
}
}