diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-12-11 18:19:11 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-12 02:19:11 +0800 |
commit | 1020d3725612b7e1225765e698138570172c841a (patch) | |
tree | 5baf6e0e2e8e68852f3267ba22a199b4bbf56b3c /lib/compress.js | |
parent | 076739db079306c103b8a6c45dde2371b25c64e4 (diff) | |
download | tracifyjs-1020d3725612b7e1225765e698138570172c841a.tar.gz tracifyjs-1020d3725612b7e1225765e698138570172c841a.zip |
fix corner case in `spread` (#4364)
fixes #4363
Diffstat (limited to 'lib/compress.js')
-rw-r--r-- | lib/compress.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js index 1862fd10..27b080bb 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -10051,7 +10051,9 @@ merge(Compressor.prototype, { found = true; var exp = prop.expression; if (compressor.option("spread") && exp instanceof AST_Object && all(exp.properties, function(prop) { - return !(prop instanceof AST_ObjectGetter || prop instanceof AST_Spread); + return !(prop instanceof AST_ObjectGetter + || prop instanceof AST_ObjectSetter && prop.key instanceof AST_Node + || prop instanceof AST_Spread); })) { changed = true; exp.properties.forEach(function(prop) { |