Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix minor parsing errors #1393

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/parser/esprima_cpp/esprima.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@

#define BEGIN_FUNCTION_SCANNING(name) \
NEW_FUNCTION_AST_BUILDER() \
auto oldInParameterParsing = this->context->inParameterParsing; \
auto oldSubCodeBlockIndex = ++this->subCodeBlockIndex; \
auto oldScopeContext = pushScopeContext(name); \
this->context->inParameterParsing = false; \
if (UNLIKELY(this->currentClassInfo != nullptr)) { \
if (this->currentClassInfo->m_firstMethod \
&& this->currentScopeContext == this->currentClassInfo->m_lastMethod->m_nextSibling) { \
Expand All @@ -91,7 +93,8 @@
this->lexicalBlockCount = lexicalBlockCountBefore; \
this->currentScopeContext->m_lexicalBlockIndexFunctionLocatedIn = lexicalBlockIndexBefore; \
popScopeContext(oldScopeContext); \
this->subCodeBlockIndex = oldSubCodeBlockIndex;
this->subCodeBlockIndex = oldSubCodeBlockIndex; \
this->context->inParameterParsing = oldInParameterParsing;

using namespace Escargot::EscargotLexer;

Expand Down Expand Up @@ -3558,6 +3561,8 @@ class Parser {
template <class ASTBuilder>
ASTNode parseStatementListItem(ASTBuilder& builder)
{
checkRecursiveLimit();

ASTNode statement = nullptr;
this->context->isAssignmentTarget = true;
this->context->isBindingElement = true;
Expand Down
Loading