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