From 348547286611eaf665b00d5ee21a8fee2c2f0660 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Sun, 1 Mar 2020 05:04:21 +0000 Subject: avoid reducing setter argument (#3737) --- test/input/reduce/setter.js | 8 ++++++++ test/input/reduce/setter.reduced.js | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 test/input/reduce/setter.js create mode 100644 test/input/reduce/setter.reduced.js (limited to 'test/input') diff --git a/test/input/reduce/setter.js b/test/input/reduce/setter.js new file mode 100644 index 00000000..87228bc4 --- /dev/null +++ b/test/input/reduce/setter.js @@ -0,0 +1,8 @@ +console.log(function f(a) { + ({ + set p(v) { + f++; + } + }); + return f.length; +}()); diff --git a/test/input/reduce/setter.reduced.js b/test/input/reduce/setter.reduced.js new file mode 100644 index 00000000..d947226f --- /dev/null +++ b/test/input/reduce/setter.reduced.js @@ -0,0 +1,19 @@ +console.log(function f(a) { + ({ + set p(v) { + f++; + } + }); + return f.length; +}()); +// output: 1 +// +// minify: 0 +// +// options: { +// "compress": { +// "keep_fargs": false, +// "unsafe": true +// }, +// "mangle": false +// } \ No newline at end of file -- cgit v1.2.3