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.js36
1 files changed, 30 insertions, 6 deletions
diff --git a/test/compress/functions.js b/test/compress/functions.js
index 983d7068..e12ce3e2 100644
--- a/test/compress/functions.js
+++ b/test/compress/functions.js
@@ -3003,12 +3003,10 @@ issue_3366: {
f();
}
expect: {
- (function() {
- function a() {}
- (function() {
- this && a && console.log("PASS");
- })();
- })();
+ void function() {
+ this && a && console.log("PASS");
+ }();
+ function a() {}
}
expect_stdout: "PASS"
}
@@ -3041,3 +3039,29 @@ issue_3371: {
}
expect_stdout: "function"
}
+
+class_iife: {
+ options = {
+ inline: true,
+ sequences: true,
+ toplevel: true,
+ }
+ input: {
+ var A = function() {
+ function B() {}
+ B.prototype.m = function() {
+ console.log("PASS");
+ };
+ return B;
+ }();
+ new A().m();
+ }
+ expect: {
+ var A = (B.prototype.m = function() {
+ console.log("PASS");
+ }, B);
+ function B() {}
+ new A().m();
+ }
+ expect_stdout: "PASS"
+}