aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-12-07 01:01:52 +0800
committerGitHub <noreply@github.com>2017-12-07 01:01:52 +0800
commit3dd495ecdd231a6b245ab002f61805b21114924b (patch)
treed0472d28f4bff91d1757a2eb366e66edf043ed77 /test
parentb9f3ddfb30897f634a7967e773d1555ceecb21cc (diff)
downloadtracifyjs-3dd495ecdd231a6b245ab002f61805b21114924b.tar.gz
tracifyjs-3dd495ecdd231a6b245ab002f61805b21114924b.zip
improve `if_return` (#2558)
`return void x()` => `x()`
Diffstat (limited to 'test')
-rw-r--r--test/compress/return_undefined.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/compress/return_undefined.js b/test/compress/return_undefined.js
index 9662aa51..4d2b4257 100644
--- a/test/compress/return_undefined.js
+++ b/test/compress/return_undefined.js
@@ -122,3 +122,25 @@ return_undefined: {
}
}
}
+
+return_void: {
+ options = {
+ if_return: true,
+ inline: true,
+ reduce_vars: true,
+ unused: true,
+ }
+ input: {
+ function f() {
+ function g() {
+ h();
+ }
+ return g();
+ }
+ }
+ expect: {
+ function f() {
+ h();
+ }
+ }
+}