aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-04-17 14:03:29 +0800
committerGitHub <noreply@github.com>2017-04-17 14:03:29 +0800
commit71a8d0d236d29015df2d1df18de11d661d17af2e (patch)
treeb671ba60c5ddc75a840af8453cdf468ef0e33cbc /test/compress
parent1a498db2d3e520d1711144c423312c62a2673115 (diff)
downloadtracifyjs-71a8d0d236d29015df2d1df18de11d661d17af2e.tar.gz
tracifyjs-71a8d0d236d29015df2d1df18de11d661d17af2e.zip
fix `reduce_vars` within try-block (#1818)
Possible partial execution due to exceptions.
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/reduce_vars.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/compress/reduce_vars.js b/test/compress/reduce_vars.js
index 6e079c1a..405dbc23 100644
--- a/test/compress/reduce_vars.js
+++ b/test/compress/reduce_vars.js
@@ -2187,3 +2187,34 @@ issue_1814_2: {
}
expect_stdout: "0 '321'"
}
+
+try_abort: {
+ options = {
+ evaluate: true,
+ reduce_vars: true,
+ unused: true,
+ }
+ input: {
+ !function() {
+ try {
+ var a = 1;
+ throw "";
+ var b = 2;
+ } catch (e) {
+ }
+ console.log(a, b);
+ }();
+ }
+ expect: {
+ !function() {
+ try {
+ var a = 1;
+ throw "";
+ var b = 2;
+ } catch (e) {
+ }
+ console.log(a, b);
+ }();
+ }
+ expect_stdout: "1 undefined"
+}