parse dynamic import correctly (#4671)

This commit is contained in:
Alex Lam S.L
2021-02-20 22:54:15 +00:00
committed by GitHub
parent 8d668c2963
commit ae09773ba0
2 changed files with 11 additions and 2 deletions

View File

@@ -848,8 +848,10 @@ function parse($TEXT, options) {
next();
return export_();
case "import":
next();
return import_();
if (!is_token(peek(), "punc", "(")) {
next();
return import_();
}
case "yield":
if (S.in_generator) return simple_statement();
break;