aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-11-26 17:31:06 +0000
committerGitHub <noreply@github.com>2020-11-27 01:31:06 +0800
commitaf1cca25bf3c29aa925bbe2a164786ebcf7dd476 (patch)
treeaf68a1f7f244df485c35a6b6c78b7f259ecde685 /test/compress
parent9b3a3636048a59518166e5afa7686a445bcf70f6 (diff)
downloadtracifyjs-af1cca25bf3c29aa925bbe2a164786ebcf7dd476.tar.gz
tracifyjs-af1cca25bf3c29aa925bbe2a164786ebcf7dd476.zip
fix corner case in `inline` (#4320)
fixes #4319
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/destructured.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/compress/destructured.js b/test/compress/destructured.js
index 6eea10d2..afc9152b 100644
--- a/test/compress/destructured.js
+++ b/test/compress/destructured.js
@@ -1684,3 +1684,29 @@ issue_4315: {
expect_stdout: "PASS"
node_version: ">=6"
}
+
+issue_4319: {
+ options = {
+ inline: true,
+ reduce_vars: true,
+ toplevel: true,
+ }
+ input: {
+ function f(a) {
+ while (!a);
+ }
+ console.log(function({}) {
+ return f(console);
+ }(0));
+ }
+ expect: {
+ function f(a) {
+ while (!a);
+ }
+ console.log(function({}) {
+ return f(console);
+ }(0));
+ }
+ expect_stdout: "undefined"
+ node_version: ">=6"
+}