aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-02-20 22:54:15 +0000
committerGitHub <noreply@github.com>2021-02-21 06:54:15 +0800
commitae09773ba017ce65b261d15ed3098ae40c3b2a1b (patch)
tree1ef30faf5da458e22e333524ea0147f694e04bc3 /lib
parent8d668c2963c4322fea47009b057791c1a7caa612 (diff)
downloadtracifyjs-ae09773ba017ce65b261d15ed3098ae40c3b2a1b.tar.gz
tracifyjs-ae09773ba017ce65b261d15ed3098ae40c3b2a1b.zip
parse dynamic `import` correctly (#4671)
Diffstat (limited to 'lib')
-rw-r--r--lib/parse.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/parse.js b/lib/parse.js
index 04b40149..39465d78 100644
--- a/lib/parse.js
+++ b/lib/parse.js
@@ -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;