aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/compress/exports.js21
-rw-r--r--test/sandbox.js2
2 files changed, 22 insertions, 1 deletions
diff --git a/test/compress/exports.js b/test/compress/exports.js
index c573223d..2da1ee33 100644
--- a/test/compress/exports.js
+++ b/test/compress/exports.js
@@ -70,6 +70,27 @@ defaults_parentheses_4: {
expect_exact: "export default(function f(){});"
}
+defaults_parentheses_5: {
+ input: {
+ export default (function(a) {
+ console.log(a[0]);
+ }`PASS`);
+ }
+ expect_exact: "export default(function(a){console.log(a[0])})`PASS`;"
+}
+
+defaults_parentheses_6: {
+ options = {
+ conditionals: true,
+ }
+ input: {
+ export default !function() {
+ while (!console);
+ }() ? "PASS" : "FAIL";
+ }
+ expect_exact: 'export default(function(){while(!console);})()?"FAIL":"PASS";'
+}
+
foreign: {
input: {
export * from "foo";
diff --git a/test/sandbox.js b/test/sandbox.js
index 1585c988..ceaf0088 100644
--- a/test/sandbox.js
+++ b/test/sandbox.js
@@ -53,7 +53,7 @@ exports.strip_exports = function(code) {
var count = 0;
return code.replace(/\bexport(?:\s*\{[^}]*};|\s+default\b(?:\s*(\(|\{|class\s*\{|class\s+(?=extends\b)|(?:async\s+)?function\s*(?:\*\s*)?\())?|\b)/g, function(match, header) {
if (!header) return "";
- if (header.length == 1) return "~" + header;
+ if (header.length == 1) return "!!" + header;
return header.slice(0, -1) + " _" + ++count + header.slice(-1);
});
};