aboutsummaryrefslogtreecommitdiff
path: root/test/compress/functions.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/compress/functions.js')
-rw-r--r--test/compress/functions.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/compress/functions.js b/test/compress/functions.js
index 2a2d0965..3a560f00 100644
--- a/test/compress/functions.js
+++ b/test/compress/functions.js
@@ -145,3 +145,25 @@ issue_1841_2: {
}
expect_exact: "42"
}
+
+function_returning_constant_literal: {
+ options = {
+ reduce_vars: true,
+ unsafe: true,
+ toplevel: true,
+ evaluate: true,
+ cascade: true,
+ unused: true,
+ }
+ input: {
+ function greeter() {
+ return { message: 'Hello there' };
+ }
+ var greeting = greeter();
+ console.log(greeting.message);
+ }
+ expect: {
+ console.log("Hello there");
+ }
+ expect_stdout: "Hello there"
+}