aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-09-15 22:51:42 +0100
committerGitHub <noreply@github.com>2020-09-16 05:51:42 +0800
commit20391850518f4050917a4812af07520eb47cfecf (patch)
treec1bd66edfb47f36988052472bde677497da4b082 /test/compress
parentad27c1420226032459157444cf7ac17bf95bd5e6 (diff)
downloadtracifyjs-20391850518f4050917a4812af07520eb47cfecf.tar.gz
tracifyjs-20391850518f4050917a4812af07520eb47cfecf.zip
enhance `conditionals` (#4106)
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/conditionals.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/compress/conditionals.js b/test/compress/conditionals.js
index ab9c4108..4d54b83a 100644
--- a/test/compress/conditionals.js
+++ b/test/compress/conditionals.js
@@ -783,6 +783,28 @@ cond_12: {
}
}
+cond_13: {
+ options = {
+ conditionals: true,
+ }
+ input: {
+ x ? y(a) : z(a);
+ x ? y.f(a) : z.f(a);
+ x ? y.f(a) : z.g(a);
+ x ? y.f()(a) : z.g()(a);
+ x ? y.f.u(a) : z.g.u(a);
+ x ? y.f().u(a) : z.g().u(a);
+ }
+ expect: {
+ (x ? y : z)(a);
+ (x ? y : z).f(a);
+ x ? y.f(a) : z.g(a);
+ (x ? y.f() : z.g())(a);
+ (x ? y.f : z.g).u(a);
+ (x ? y.f() : z.g()).u(a);
+ }
+}
+
ternary_boolean_consequent: {
options = {
booleans: true,