diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp index 124fda829a45..109e4d4d52fd 100644 --- a/js/src/frontend/Parser.cpp +++ b/js/src/frontend/Parser.cpp @@ -3557,7 +3557,7 @@ Parser::statementList(YieldHandling yieldHandling) return null(); statementBegin = pos.begin; } - Node next = statement(yieldHandling, canHaveDirectives); + Node next = statementListItem(yieldHandling, canHaveDirectives); if (!next) { if (tokenStream.isEOF()) isUnexpectedEOF_ = true; @@ -5405,7 +5405,7 @@ Parser::switchStatement(YieldHandling yieldHandling) return null(); statementBegin = pos.begin; } - Node stmt = statement(yieldHandling); + Node stmt = statementListItem(yieldHandling); if (!stmt) return null(); if (!warnedAboutStatementsAfterReturn) {