aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-01-13 14:17:24 +0000
committerGitHub <noreply@github.com>2021-01-13 22:17:24 +0800
commit24917e7084a9ce240660f8d4b69dcbf1515af084 (patch)
tree5ee6cb07039b9247eb316e5bd8932f49e9dd313e /test
parente84957e3dabeb676113da5d513cde07981bcfbaa (diff)
downloadtracifyjs-24917e7084a9ce240660f8d4b69dcbf1515af084.tar.gz
tracifyjs-24917e7084a9ce240660f8d4b69dcbf1515af084.zip
fix corner case in `evaluate` (#4553)
fixes #4552
Diffstat (limited to 'test')
-rw-r--r--test/compress/evaluate.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/compress/evaluate.js b/test/compress/evaluate.js
index 73c982f2..2b1bbc01 100644
--- a/test/compress/evaluate.js
+++ b/test/compress/evaluate.js
@@ -3142,3 +3142,36 @@ issue_4480: {
}
expect_stdout: "PASS"
}
+
+issue_4552: {
+ options = {
+ evaluate: true,
+ keep_fnames: true,
+ reduce_vars: true,
+ toplevel: true,
+ unused: true,
+ }
+ input: {
+ var a = function f(b) {
+ return function() {
+ b++;
+ try {
+ return b;
+ } catch (e) {}
+ }();
+ }();
+ console.log(a);
+ }
+ expect: {
+ var a = function f(b) {
+ return function() {
+ b++;
+ try {
+ return b;
+ } catch (e) {}
+ }();
+ }();
+ console.log(a);
+ }
+ expect_stdout: "NaN"
+}