aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/compress/destructured.js20
-rw-r--r--test/reduce.js6
2 files changed, 26 insertions, 0 deletions
diff --git a/test/compress/destructured.js b/test/compress/destructured.js
index 81beb7f7..1c448f2a 100644
--- a/test/compress/destructured.js
+++ b/test/compress/destructured.js
@@ -1886,3 +1886,23 @@ issue_4386: {
expect_stdout: "PASS"
node_version: ">=6"
}
+
+issue_4395: {
+ options = {
+ arguments: true,
+ }
+ input: {
+ console.log(function(a, {}) {
+ a = "FAIL";
+ return arguments[0];
+ }("PASS", 42));
+ }
+ expect: {
+ console.log(function(a, {}) {
+ a = "FAIL";
+ return arguments[0];
+ }("PASS", 42));
+ }
+ expect_stdout: "PASS"
+ node_version: ">=6"
+}
diff --git a/test/reduce.js b/test/reduce.js
index db4b7521..1ab18411 100644
--- a/test/reduce.js
+++ b/test/reduce.js
@@ -175,6 +175,12 @@ module.exports = function reduce_test(testcase, minify_options, reduce_options)
CHANGED = true;
return expr instanceof U.AST_Spread ? expr.expression : expr;
}
+ if (node.expression instanceof U.AST_Arrow && node.expression.value) {
+ var seq = node.args.slice();
+ seq.push(node.expression.value);
+ CHANGED = true;
+ return to_sequence(seq);
+ }
if (node.expression instanceof U.AST_Function) {
// hoist and return expressions from the IIFE function expression
var body = node.expression.body;