Browse Source

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

Co-authored-by: Halid Odat <halidodat@gmail.com>
pull/836/head
Paul Lancaster 4 years ago committed by GitHub
parent
commit
4c0c1238ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  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::Async) => {
TokenKind::Keyword(Keyword::Function | 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