diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2021-03-06 14:49:39 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-06 22:49:39 +0800 |
commit | ad903e924050067a96a33f2eb5a0b9ab3e5454c1 (patch) | |
tree | 4729dfc4dd369cf9bb8d8f8eed8c9b1e276cb5f1 /test/compress/exports.js | |
parent | 83c3838b07ed9ff32a83a39d5c1cbf40155c46f2 (diff) | |
download | tracifyjs-ad903e924050067a96a33f2eb5a0b9ab3e5454c1.tar.gz tracifyjs-ad903e924050067a96a33f2eb5a0b9ab3e5454c1.zip |
fix corner cases with `export` (#4743)
fixes #4742
Diffstat (limited to 'test/compress/exports.js')
-rw-r--r-- | test/compress/exports.js | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/test/compress/exports.js b/test/compress/exports.js index 2da1ee33..a7239148 100644 --- a/test/compress/exports.js +++ b/test/compress/exports.js @@ -382,3 +382,62 @@ single_use_class_default: { A.prototype.p = "PASS"; } } + +issue_4742_join_vars_1: { + options = { + join_vars: true, + } + input: { + var a = 42; + export var a; + } + expect: { + var a = 42; + export var a; + } +} + +issue_4742_join_vars_2: { + options = { + join_vars: true, + } + input: { + export var a = "foo"; + var b; + b = "bar"; + } + expect: { + export var a = "foo"; + var b, b = "bar"; + } +} + +issue_4742_unused_1: { + options = { + unused: true, + } + input: { + var a = 42; + export var a; + } + expect: { + var a = 42; + export var a; + } +} + +issue_4742_unused_2: { + options = { + reduce_vars: true, + toplevel: true, + unused: true, + } + input: { + export var a = "foo"; + var a = "bar"; + } + expect: { + export var a = "foo"; + a = "bar"; + } +} |