diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2021-04-25 15:37:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-25 22:37:26 +0800 |
commit | 80efaa2f331b2c3f3ec35218d1086830a39bec93 (patch) | |
tree | b5ad373328665649e1a7da5ef862e04923a7c9b6 | |
parent | a1a212f6393f690180a606c0610a4ca9279522ad (diff) | |
download | tracifyjs-80efaa2f331b2c3f3ec35218d1086830a39bec93.tar.gz tracifyjs-80efaa2f331b2c3f3ec35218d1086830a39bec93.zip |
fix corner case with `export` (#4871)
-rw-r--r-- | lib/parse.js | 1 | ||||
-rw-r--r-- | test/compress/exports.js | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/parse.js b/lib/parse.js index 323769a2..cdd607a2 100644 --- a/lib/parse.js +++ b/lib/parse.js @@ -1495,6 +1495,7 @@ function parse($TEXT, options) { body.start = start; body.end = prev(); } else { + handle_regexp(); body = expression(); semicolon(); } diff --git a/test/compress/exports.js b/test/compress/exports.js index bc436283..0917648b 100644 --- a/test/compress/exports.js +++ b/test/compress/exports.js @@ -91,6 +91,13 @@ defaults_parentheses_6: { expect_exact: 'export default(function(){while(!console);})()?"FAIL":"PASS";' } +defaults_regexp: { + input: { + export default /foo/; + } + expect_exact: "export default/foo/;" +} + foreign: { input: { export * from "foo"; |