From c1256c399a4db3228b461a742c66deb1ea5064e5 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Fri, 18 Dec 2020 00:41:13 +0000 Subject: fix corner case in `arguments` (#4396) fixes #4395 --- lib/compress.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/compress.js b/lib/compress.js index b8f4b3a5..4279dc7c 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -9897,7 +9897,10 @@ merge(Compressor.prototype, { } else if (argname instanceof AST_Destructured) { argname = null; } else if (argname && (compressor.has_directive("use strict") - || !(fn_parent instanceof AST_Call && index < fn_parent.args.length))) { + || !(fn_parent instanceof AST_Call && index < fn_parent.args.length) + || !all(fn.argnames, function(argname) { + return !(argname instanceof AST_Destructured); + }))) { var arg_def = argname.definition(); if (!compressor.option("reduce_vars") || def.reassigned -- cgit v1.2.3