aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-11-17 06:43:04 +0000
committerGitHub <noreply@github.com>2020-11-17 14:43:04 +0800
commit2a612fd472b4d26fee4342fb57fe9ec54ab124cb (patch)
treeb68b3debf36fc688407dc4fc9fa4b64e1ef8998f /lib/compress.js
parentb9798a01a83269a6299d1f1e28d1e8f6d51b5726 (diff)
downloadtracifyjs-2a612fd472b4d26fee4342fb57fe9ec54ab124cb.tar.gz
tracifyjs-2a612fd472b4d26fee4342fb57fe9ec54ab124cb.zip
fix corner case in `reduce_vars` (#4283)
fixes #4282
Diffstat (limited to 'lib/compress.js')
-rw-r--r--lib/compress.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js
index a16c9a69..b8725b32 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -616,7 +616,11 @@ merge(Compressor.prototype, {
if (node instanceof AST_DestructuredObject) {
var save = fixed;
node.properties.forEach(function(node) {
- if (node.key instanceof AST_Node) node.key.walk(tw);
+ if (node.key instanceof AST_Node) {
+ push(tw);
+ node.key.walk(tw);
+ pop(tw);
+ }
fixed = function() {
var key = node.key;
var type = AST_Sub;