aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-10-03 11:27:17 +0100
committerGitHub <noreply@github.com>2020-10-03 18:27:17 +0800
commit142bd1bd1a77c0893e7b88268ef1a4d4f1be13d0 (patch)
tree0597b1cbf48a89b518033903cae3e87e7edbb491 /test
parent8cb509d50e8bbc4c79d9bd0274a625f5ec37fe42 (diff)
downloadtracifyjs-142bd1bd1a77c0893e7b88268ef1a4d4f1be13d0.tar.gz
tracifyjs-142bd1bd1a77c0893e7b88268ef1a4d4f1be13d0.zip
workaround quirks on latter specs (#4172)
closes #4171
Diffstat (limited to 'test')
-rw-r--r--test/compress/functions.js68
1 files changed, 68 insertions, 0 deletions
diff --git a/test/compress/functions.js b/test/compress/functions.js
index 13368169..745de9db 100644
--- a/test/compress/functions.js
+++ b/test/compress/functions.js
@@ -4892,3 +4892,71 @@ direct_inline_catch_redefined: {
}
expect_stdout: true
}
+
+issue_4171_1: {
+ options = {
+ functions: true,
+ reduce_vars: true,
+ unused: true,
+ }
+ input: {
+ console.log(function(a) {
+ try {
+ while (a)
+ var e = function() {};
+ } catch (e) {
+ return function() {
+ return e;
+ };
+ }
+ }(!console));
+ }
+ expect: {
+ console.log(function(a) {
+ try {
+ while (a)
+ var e = function() {};
+ } catch (e) {
+ return function() {
+ return e;
+ };
+ }
+ }(!console));
+ }
+ expect_stdout: "undefined"
+}
+
+issue_4171_2: {
+ options = {
+ functions: true,
+ reduce_vars: true,
+ unused: true,
+ }
+ input: {
+ console.log(function(a) {
+ try {
+ while (a);
+ } catch (e) {
+ return function() {
+ return e;
+ };
+ } finally {
+ var e = function() {};
+ }
+ }(!console));
+ }
+ expect: {
+ console.log(function(a) {
+ try {
+ while (a);
+ } catch (e) {
+ return function() {
+ return e;
+ };
+ } finally {
+ function e() {}
+ }
+ }(!console));
+ }
+ expect_stdout: "undefined"
+}