mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-29 10:02:14 +00:00
1. use typed allocate for all long-live objects
2. implicitly delete AST when ast is useless 3. allocate String::emptyString correctly 4. hide ptr in LeakChecker for better tracing Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
This commit is contained in:
parent
f95fd596ef
commit
2fc34d628a
44 changed files with 350 additions and 140 deletions
|
|
@ -5455,6 +5455,8 @@ public:
|
|||
|
||||
BlockStatementNode* parseFunctionSourceElements()
|
||||
{
|
||||
bool parseSingleFunction = this->config.parseSingleFunction;
|
||||
this->config.parseSingleFunction = false;
|
||||
MetaNode nodeStart = this->createNode();
|
||||
|
||||
this->expect(LeftBrace);
|
||||
|
|
@ -5493,7 +5495,14 @@ public:
|
|||
scopeContexts.back()->m_locEnd.column = nodeEnd.column;
|
||||
scopeContexts.back()->m_locEnd.index = nodeEnd.index;
|
||||
|
||||
return this->finalize(nodeStart, new BlockStatementNode(std::move(body)));
|
||||
if (parseSingleFunction) {
|
||||
return this->finalize(nodeStart, new BlockStatementNode(std::move(body)));
|
||||
} else {
|
||||
for (size_t i = 0; i < body.size(); i++) {
|
||||
delete body[i];
|
||||
}
|
||||
return this->finalize(nodeStart, new BlockStatementNode(std::move(StatementNodeVector())));
|
||||
}
|
||||
}
|
||||
|
||||
FunctionDeclarationNode* parseFunctionDeclaration(bool identifierIsOptional = false)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue