mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
parent
6360bdad31
commit
398dbfd2a7
2 changed files with 7 additions and 2 deletions
|
|
@ -349,7 +349,9 @@ impl<'a> Parser<'a> {
|
|||
}
|
||||
Kind::TemplateHead => {
|
||||
quasis.push(self.parse_template_element(tagged));
|
||||
expressions.push(self.parse_expression()?);
|
||||
// TemplateHead Expression[+In, ?Yield, ?Await]
|
||||
let expr = self.with_context(Context::In, Self::parse_expression)?;
|
||||
expressions.push(expr);
|
||||
self.re_lex_template_substitution_tail();
|
||||
loop {
|
||||
match self.cur_kind() {
|
||||
|
|
@ -362,7 +364,9 @@ impl<'a> Parser<'a> {
|
|||
quasis.push(self.parse_template_element(tagged));
|
||||
}
|
||||
_ => {
|
||||
expressions.push(self.parse_expression()?);
|
||||
// TemplateMiddle Expression[+In, ?Yield, ?Await]
|
||||
let expr = self.with_context(Context::In, Self::parse_expression)?;
|
||||
expressions.push(expr);
|
||||
self.re_lex_template_substitution_tail();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -291,6 +291,7 @@ mod test {
|
|||
"null?async():null",
|
||||
"switch(null){case async():}",
|
||||
"for(new null(null in null);;);",
|
||||
"for(`${null in null}`;;);",
|
||||
];
|
||||
|
||||
for source in pass {
|
||||
|
|
|
|||
Loading…
Reference in a new issue