From 63adfb1590886b9b03827805e1226bfe235e5868 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Sun, 10 May 2020 15:23:09 +0100 Subject: fix corner case in `hoist_props` (#3872) fixes #3871 --- lib/compress.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/compress.js b/lib/compress.js index 4f5e9253..5509137b 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -4931,7 +4931,11 @@ merge(Compressor.prototype, { if (def.single_use) return; if (top_retain(def)) return; if (sym.fixed_value() !== right) return; - return right instanceof AST_Object && right.properties.length > 0; + return right instanceof AST_Object + && right.properties.length > 0 + && all(right.properties, function(prop) { + return prop instanceof AST_ObjectKeyVal; + }); } }); -- cgit v1.2.3