From ba4a771bbccb0b6026588a56b0c31f5bac466775 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Fri, 26 Feb 2021 20:56:34 +0000 Subject: support limited `ufuzz` testing for `export` (#4693) fixes #4692 --- test/compress/exports.js | 60 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) (limited to 'test/compress') diff --git a/test/compress/exports.js b/test/compress/exports.js index 425b0245..c573223d 100644 --- a/test/compress/exports.js +++ b/test/compress/exports.js @@ -56,6 +56,20 @@ defaults_parentheses_2: { expect_exact: 'export default(async function(){console.log("PASS")})();' } +defaults_parentheses_3: { + input: { + export default (42, "PASS"); + } + expect_exact: 'export default(42,"PASS");' +} + +defaults_parentheses_4: { + input: { + export default (function f() {}); + } + expect_exact: "export default(function f(){});" +} + foreign: { input: { export * from "foo"; @@ -203,6 +217,20 @@ hoist_exports: { } } +hoist_vars: { + options = { + hoist_vars: true, + } + input: { + var a; + export var b = 42; + } + expect: { + var a; + export var b = 42; + } +} + keep_return_values: { options = { booleans: true, @@ -301,3 +329,35 @@ single_use_default: { f(); } } + +single_use_class: { + options = { + reduce_vars: true, + toplevel: true, + unused: true, + } + input: { + export class A {} + A.prototype.p = "PASS"; + } + expect: { + export class A {} + A.prototype.p = "PASS"; + } +} + +single_use_class_default: { + options = { + reduce_vars: true, + toplevel: true, + unused: true, + } + input: { + export default class A {} + A.prototype.p = "PASS"; + } + expect: { + export default class A {} + A.prototype.p = "PASS"; + } +} -- cgit v1.2.3