Skip to content

Commit

Permalink
fix corner case with export (#4871)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlamsl committed Apr 25, 2021
1 parent a1a212f commit 80efaa2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/parse.js
Expand Up @@ -1495,6 +1495,7 @@ function parse($TEXT, options) {
body.start = start;
body.end = prev();
} else {
handle_regexp();
body = expression();
semicolon();
}
Expand Down
7 changes: 7 additions & 0 deletions test/compress/exports.js
Expand Up @@ -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";
Expand Down

0 comments on commit 80efaa2

Please sign in to comment.