diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2021-04-07 15:37:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-07 22:37:15 +0800 |
commit | a37ca558dd8d7f5243e061e216287793b9108911 (patch) | |
tree | 6870fa7c80ed55abc6a416c6a763633685bcaaa2 /lib/parse.js | |
parent | 73a564343b8231f2278c37c00c444b2cac8e314d (diff) | |
download | tracifyjs-a37ca558dd8d7f5243e061e216287793b9108911.tar.gz tracifyjs-a37ca558dd8d7f5243e061e216287793b9108911.zip |
reject invalid `for await` syntax (#4847)
Diffstat (limited to 'lib/parse.js')
-rw-r--r-- | lib/parse.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/parse.js b/lib/parse.js index bc13b60e..323769a2 100644 --- a/lib/parse.js +++ b/lib/parse.js @@ -1189,7 +1189,7 @@ function parse($TEXT, options) { var await = is("name", "await") && next(); expect("("); var init = null; - if (!is("punc", ";")) { + if (await || !is("punc", ";")) { init = is("keyword", "const") ? (next(), const_(true)) : is("keyword", "let") |