aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-02-27 13:06:23 +0000
committerGitHub <noreply@github.com>2021-02-27 21:06:23 +0800
commit7924a3ae8b7bb69c246215618768eda04987b91d (patch)
tree26e5bcd9c8da0069d9c07a25c8fde7384f4ea2f0 /test
parent13ad10a6b532bc7d31c72e2cb9a8a39999824466 (diff)
downloadtracifyjs-7924a3ae8b7bb69c246215618768eda04987b91d.tar.gz
tracifyjs-7924a3ae8b7bb69c246215618768eda04987b91d.zip
improve `export` compatibility mode (#4704)
Diffstat (limited to 'test')
-rw-r--r--test/sandbox.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/sandbox.js b/test/sandbox.js
index b369ba81..adee26cb 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*?(?:$|\n|;)|\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 "0, " + header;
return header.slice(0, -1) + " _" + ++count + header.slice(-1);
});
};