From: Alex Lam S.L Date: Sun, 25 Apr 2021 14:37:26 +0000 (+0100) Subject: fix corner case with `export` (#4871) X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=80efaa2f331b2c3f3ec35218d1086830a39bec93;p=UglifyJS.git fix corner case with `export` (#4871) --- 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";