aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-03-17 00:26:48 +0800
committerGitHub <noreply@github.com>2017-03-17 00:26:48 +0800
commitac403018135b0ba700ef6223970c1bbc2a518107 (patch)
treefafe0f1088d30ba7e599c76cb4663fe9a4e96571 /lib/compress.js
parent3563d8c09e36be8f8b9cb9500852778f8d191d5d (diff)
downloadtracifyjs-ac403018135b0ba700ef6223970c1bbc2a518107.tar.gz
tracifyjs-ac403018135b0ba700ef6223970c1bbc2a518107.zip
fix chained evaluation (#1610)
`reduce_vars` enables substitution of variables but did not clone the value's `AST_Node`. This confuses `collapse_vars` and result in invalid AST and subsequent crash. fixes #1609
Diffstat (limited to 'lib/compress.js')
-rw-r--r--lib/compress.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js
index dac1f364..c3f12549 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -3461,7 +3461,7 @@ merge(Compressor.prototype, {
}
}
if (d.should_replace) {
- return d.should_replace;
+ return d.should_replace.clone(true);
}
}
}