aboutsummaryrefslogtreecommitdiff
path: root/test/compress/exports.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/compress/exports.js')
-rw-r--r--test/compress/exports.js35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/compress/exports.js b/test/compress/exports.js
index afa546ec..75ce5a43 100644
--- a/test/compress/exports.js
+++ b/test/compress/exports.js
@@ -142,3 +142,38 @@ mangle_rename: {
}
}
}
+
+hoist_exports: {
+ options = {
+ evaluate: true,
+ hoist_exports: true,
+ reduce_vars: true,
+ toplevel: true,
+ unused: true,
+ }
+ mangle = {
+ toplevel: true,
+ }
+ input: {
+ const a = 42;
+ export let bbb, { foo: ccc } = a;
+ export function fff(d, { [bbb]: e }) {
+ d(e, fff);
+ }
+ export default a;
+ export default async function g(x, ...{ [ccc]: y }) {
+ (await x)(g, y);
+ }
+ }
+ expect: {
+ let f, { foo: o } = 42;
+ function c(t, { [f]: a }) {
+ t(a, c);
+ }
+ export default 42;
+ export default async function t(a, ...{ [o]: f }) {
+ (await a)(t, f);
+ };
+ export { f as bbb, o as ccc, c as fff };
+ }
+}