diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2018-03-11 15:54:43 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-11 15:54:43 +0800 |
commit | b9f72a4a81d69a7dd782a5ee70f7eee1cb4aa0e0 (patch) | |
tree | 7f4699b6e606a3e44a731083d1796c0ccc779056 /lib/compress.js | |
parent | fc6ebd04a59024dfd3b40b43825a007c62bac2b3 (diff) | |
download | tracifyjs-b9f72a4a81d69a7dd782a5ee70f7eee1cb4aa0e0.tar.gz tracifyjs-b9f72a4a81d69a7dd782a5ee70f7eee1cb4aa0e0.zip |
handle `case` correctly under `reduce_vars` (#2993)
fixes #2992
Diffstat (limited to 'lib/compress.js')
-rw-r--r-- | lib/compress.js | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/lib/compress.js b/lib/compress.js index 2f109a17..1b52f83e 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -517,6 +517,15 @@ merge(Compressor.prototype, { pop(tw); return true; }); + def(AST_Case, function(tw) { + push(tw); + this.expression.walk(tw); + pop(tw); + push(tw); + walk_body(this, tw); + pop(tw); + return true; + }); def(AST_Conditional, function(tw) { this.condition.walk(tw); push(tw); @@ -527,6 +536,12 @@ merge(Compressor.prototype, { pop(tw); return true; }); + def(AST_Default, function(tw, descend) { + push(tw); + descend(); + pop(tw); + return true; + }); def(AST_Defun, function(tw, descend, compressor) { this.inlined = false; var save_ids = tw.safe_ids; @@ -624,12 +639,6 @@ merge(Compressor.prototype, { pop(tw); return true; }); - def(AST_SwitchBranch, function(tw, descend) { - push(tw); - descend(); - pop(tw); - return true; - }); def(AST_SymbolCatch, function() { this.definition().fixed = false; }); |