diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2017-03-17 00:26:48 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-17 00:26:48 +0800 |
commit | ac403018135b0ba700ef6223970c1bbc2a518107 (patch) | |
tree | fafe0f1088d30ba7e599c76cb4663fe9a4e96571 /lib/compress.js | |
parent | 3563d8c09e36be8f8b9cb9500852778f8d191d5d (diff) | |
download | tracifyjs-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.js | 2 |
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); } } } |