diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2021-01-05 17:26:19 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-06 01:26:19 +0800 |
commit | 4c89550c43974d5d570f132b2d8bc105c05cc618 (patch) | |
tree | bdc0f1c7877cd8046aa4d587dae68626b24ecbf3 /lib | |
parent | 7ebfb22d16a314404e1255aee9a470e1dd7b0af4 (diff) | |
download | tracifyjs-4c89550c43974d5d570f132b2d8bc105c05cc618.tar.gz tracifyjs-4c89550c43974d5d570f132b2d8bc105c05cc618.zip |
fix corner case in`default_values` (#4511)
fixes #4510
Diffstat (limited to 'lib')
-rw-r--r-- | lib/compress.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js index 1714306e..dcb2cc4c 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -6143,8 +6143,9 @@ merge(Compressor.prototype, { var values = value instanceof AST_Array && value.elements; var elements = []; node.elements.forEach(function(element, index) { - if (element instanceof AST_Hole) return; value = values && values[index]; + if (value instanceof AST_Spread) value = values = null; + if (element instanceof AST_Hole) return; element = element.transform(trimmer); if (element) elements[index] = element; }); |