fix corner case with export (#4871)

This commit is contained in:
Alex Lam S.L 2021-04-25 15:37:26 +01:00 committed by GitHub
parent a1a212f639
commit 80efaa2f33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -1495,6 +1495,7 @@ function parse($TEXT, options) {
body.start = start;
body.end = prev();
} else {
handle_regexp();
body = expression();
semicolon();
}

View File

@ -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";