aboutsummaryrefslogtreecommitdiff
path: root/test/compress/functions.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-09-30 14:03:28 +0100
committerGitHub <noreply@github.com>2020-09-30 21:03:28 +0800
commit090ee895e12ff7e985a972c448b7d29f63e12696 (patch)
treef315f2db141dcd4e3f0727f3a870981104e60596 /test/compress/functions.js
parent1cd1a1e5eefc6e7c61ab7c6023fea06515535013 (diff)
downloadtracifyjs-090ee895e12ff7e985a972c448b7d29f63e12696.tar.gz
tracifyjs-090ee895e12ff7e985a972c448b7d29f63e12696.zip
enhance `inline` (#4163)
Diffstat (limited to 'test/compress/functions.js')
-rw-r--r--test/compress/functions.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/compress/functions.js b/test/compress/functions.js
index 4d753469..0cd07dda 100644
--- a/test/compress/functions.js
+++ b/test/compress/functions.js
@@ -4829,3 +4829,27 @@ issue_4159: {
}
expect_stdout: "42 42"
}
+
+direct_inline: {
+ options = {
+ inline: true,
+ reduce_vars: true,
+ unused: true,
+ }
+ input: {
+ function f(a, b) {
+ function g(c) {
+ return c >> 1;
+ }
+ return g(a) + g(b);
+ }
+ console.log(f(13, 31));
+ }
+ expect: {
+ function f(a, b) {
+ return (a >> 1) + (b >> 1);
+ }
+ console.log(f(13, 31));
+ }
+ expect_stdout: "21"
+}