aboutsummaryrefslogtreecommitdiff
path: root/test/compress/keep_fargs.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2019-05-19 12:59:40 +0800
committerGitHub <noreply@github.com>2019-05-19 12:59:40 +0800
commitae77ebe5a5f1be4b2634036f48d8b570b569cb21 (patch)
tree754c0f68fd2ae5f06b3bd006a35c2b8eea22da0e /test/compress/keep_fargs.js
parent04439edceccfdc450901907cd248425b3ba384ae (diff)
downloadtracifyjs-ae77ebe5a5f1be4b2634036f48d8b570b569cb21.tar.gz
tracifyjs-ae77ebe5a5f1be4b2634036f48d8b570b569cb21.zip
fix corner case in `arguments` (#3421)
fixes #3420
Diffstat (limited to 'test/compress/keep_fargs.js')
-rw-r--r--test/compress/keep_fargs.js66
1 files changed, 66 insertions, 0 deletions
diff --git a/test/compress/keep_fargs.js b/test/compress/keep_fargs.js
index b23e96f0..558b10bb 100644
--- a/test/compress/keep_fargs.js
+++ b/test/compress/keep_fargs.js
@@ -1051,3 +1051,69 @@ function_name_mangle_ie8: {
expect_exact: "(function(){console.log(typeof function o(){})})();"
expect_stdout: "function"
}
+
+issue_3420_1: {
+ options = {
+ keep_fargs: "strict",
+ unused: true,
+ }
+ input: {
+ console.log(function() {
+ return function(a, b, c, d) {
+ return a + b;
+ };
+ }().length);
+ }
+ expect: {
+ console.log(function() {
+ return function(a, b, c, d) {
+ return a + b;
+ };
+ }().length);
+ }
+ expect_stdout: "4"
+}
+
+issue_3420_2: {
+ options = {
+ inline: true,
+ keep_fargs: "strict",
+ unused: true,
+ }
+ input: {
+ console.log(function() {
+ return function(a, b, c, d) {
+ return a + b;
+ };
+ }().length);
+ }
+ expect: {
+ console.log(function(a, b, c, d) {
+ return a + b;
+ }.length);
+ }
+ expect_stdout: "4"
+}
+
+issue_3420_3: {
+ options = {
+ inline: true,
+ keep_fargs: "strict",
+ reduce_vars: true,
+ unused: true,
+ }
+ input: {
+ console.log(function() {
+ function f(a, b, c, d) {
+ return a + b;
+ }
+ return f;
+ }().length);
+ }
+ expect: {
+ console.log(function(a, b, c, d) {
+ return a + b;
+ }.length);
+ }
+ expect_stdout: "4"
+}