diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-09-15 22:51:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-16 05:51:42 +0800 |
commit | 20391850518f4050917a4812af07520eb47cfecf (patch) | |
tree | c1bd66edfb47f36988052472bde677497da4b082 /test/compress | |
parent | ad27c1420226032459157444cf7ac17bf95bd5e6 (diff) | |
download | tracifyjs-20391850518f4050917a4812af07520eb47cfecf.tar.gz tracifyjs-20391850518f4050917a4812af07520eb47cfecf.zip |
enhance `conditionals` (#4106)
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/conditionals.js | 22 |
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, |