aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-03-11 01:16:16 +0000
committerGitHub <noreply@github.com>2021-03-11 09:16:16 +0800
commit862b1b77b5215dce8b4b3ff7a266e4083554869a (patch)
tree545018692dd7b90d4f4d2327f75a204c7d1904de /test/compress
parentb4944a31a4f56ddad53046145d9d7431d5827ada (diff)
downloadtracifyjs-862b1b77b5215dce8b4b3ff7a266e4083554869a.tar.gz
tracifyjs-862b1b77b5215dce8b4b3ff7a266e4083554869a.zip
fix corner cases in `merge_vars` & with `exports` (#4762)
fixes #4761
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/exports.js7
-rw-r--r--test/compress/merge_vars.js20
2 files changed, 27 insertions, 0 deletions
diff --git a/test/compress/exports.js b/test/compress/exports.js
index 3aaae4ae..33059bca 100644
--- a/test/compress/exports.js
+++ b/test/compress/exports.js
@@ -457,3 +457,10 @@ issue_4742_unused_2: {
a = "bar";
}
}
+
+issue_4761: {
+ input: {
+ export default "function" == 42;
+ }
+ expect_exact: 'export default"function"==42;'
+}
diff --git a/test/compress/merge_vars.js b/test/compress/merge_vars.js
index a26c0dd8..0494acfb 100644
--- a/test/compress/merge_vars.js
+++ b/test/compress/merge_vars.js
@@ -3281,3 +3281,23 @@ issue_4759: {
}
expect_stdout: "undefined"
}
+
+issue_4761: {
+ options = {
+ merge_vars: true,
+ toplevel: true,
+ }
+ input: {
+ var a = "FAIL", b;
+ try {
+ !a && --a && (b = 0)[console] || console.log(b);
+ } catch (e) {}
+ }
+ expect: {
+ var a = "FAIL", b;
+ try {
+ !a && --a && (b = 0)[console] || console.log(b);
+ } catch (e) {}
+ }
+ expect_stdout: "undefined"
+}