aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-06-23 06:59:53 +0800
committerGitHub <noreply@github.com>2017-06-23 06:59:53 +0800
commitb3a57ff019bf5c64783f55e581aa4270a52d9d13 (patch)
tree1a6c2c7e0d1ff081f15915f6cab03a201ab537bb /lib/compress.js
parent3d5bc081851897648ccc71009a2138240fe41fa0 (diff)
downloadtracifyjs-b3a57ff019bf5c64783f55e581aa4270a52d9d13.tar.gz
tracifyjs-b3a57ff019bf5c64783f55e581aa4270a52d9d13.zip
minimise `reduce_vars` cloning overhead (#2148)
Diffstat (limited to 'lib/compress.js')
-rw-r--r--lib/compress.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/compress.js b/lib/compress.js
index c332282f..8890759f 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -3887,7 +3887,7 @@ merge(Compressor.prototype, {
var d = self.definition();
var fixed = self.fixed_value();
if (fixed instanceof AST_Defun) {
- d.fixed = fixed = make_node(AST_Function, fixed, fixed).clone(true);
+ d.fixed = fixed = make_node(AST_Function, fixed, fixed);
}
if (compressor.option("unused")
&& fixed instanceof AST_Function
@@ -3895,7 +3895,7 @@ merge(Compressor.prototype, {
&& !(d.scope.uses_arguments && d.orig[0] instanceof AST_SymbolFunarg)
&& !d.scope.uses_eval
&& compressor.find_parent(AST_Scope) === fixed.parent_scope) {
- return fixed;
+ return fixed.clone(true);
}
if (compressor.option("evaluate") && fixed) {
if (d.should_replace === undefined) {