Browse Source

Fixed async function decl parse

pull/836/head
Paul Lancaster 4 years ago
parent
commit
5568fd41eb
  1. 2
      boa/src/syntax/parser/statement/mod.rs

2
boa/src/syntax/parser/statement/mod.rs

@ -390,7 +390,7 @@ where
let tok = cursor.peek(0)?.ok_or(ParseError::AbruptEnd)?;
match *tok.kind() {
TokenKind::Keyword(Keyword::Function) => {
TokenKind::Keyword(Keyword::Function) | TokenKind::Keyword(Keyword::Async) => {
if strict_mode && self.in_block {
return Err(ParseError::lex(LexError::Syntax(
"Function declaration in blocks not allowed in strict mode".into(),

Loading…
Cancel
Save