aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/exports.js74
1 files changed, 74 insertions, 0 deletions
diff --git a/test/compress/exports.js b/test/compress/exports.js
index e0690503..425b0245 100644
--- a/test/compress/exports.js
+++ b/test/compress/exports.js
@@ -227,3 +227,77 @@ keep_return_values: {
}
}
}
+
+in_use: {
+ options = {
+ pure_getters: "strict",
+ reduce_vars: true,
+ toplevel: true,
+ unused: true,
+ }
+ input: {
+ export function f() {}
+ f.prototype.p = 42;
+ }
+ expect: {
+ export function f() {}
+ f.prototype.p = 42;
+ }
+}
+
+in_use_default: {
+ options = {
+ pure_getters: "strict",
+ reduce_vars: true,
+ toplevel: true,
+ unused: true,
+ }
+ input: {
+ export default function f() {}
+ f.prototype.p = 42;
+ }
+ expect: {
+ export default function f() {}
+ f.prototype.p = 42;
+ }
+}
+
+single_use: {
+ options = {
+ reduce_vars: true,
+ toplevel: true,
+ unused: true,
+ }
+ input: {
+ export function f() {
+ console.log("PASS");
+ }
+ f();
+ }
+ expect: {
+ export function f() {
+ console.log("PASS");
+ }
+ f();
+ }
+}
+
+single_use_default: {
+ options = {
+ reduce_vars: true,
+ toplevel: true,
+ unused: true,
+ }
+ input: {
+ export default function f() {
+ console.log("PASS");
+ }
+ f();
+ }
+ expect: {
+ export default function f() {
+ console.log("PASS");
+ }
+ f();
+ }
+}