public
/
UglifyJS.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
13ad10a
)
improve `export` compatibility mode (#4704)
author
Alex Lam S.L
<alexlamsl@gmail.com>
Sat, 27 Feb 2021 13:06:23 +0000
(13:06 +0000)
committer
GitHub
<noreply@github.com>
Sat, 27 Feb 2021 13:06:23 +0000
(21:06 +0800)
test/sandbox.js
patch
|
blob
|
history
diff --git
a/test/sandbox.js
b/test/sandbox.js
index
b369ba8
..
adee26c
100644
(file)
--- 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);
});
};