mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
Fix generation of arguments object used in nested arrow functions and eval codes
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
This commit is contained in:
parent
7589396230
commit
5fcdf4e101
7 changed files with 52 additions and 26 deletions
|
|
@ -174,7 +174,6 @@ InterpretedCodeBlock* ScriptParser::generateCodeBlockTreeFromASTWalker(Context*
|
|||
}
|
||||
|
||||
AtomicString arguments = ctx->staticStrings().arguments;
|
||||
|
||||
for (size_t i = 0; i < scopeCtx->m_childBlockScopes.size(); i++) {
|
||||
ASTBlockContext* childBlockContext = scopeCtx->m_childBlockScopes[i];
|
||||
|
||||
|
|
@ -201,7 +200,8 @@ InterpretedCodeBlock* ScriptParser::generateCodeBlockTreeFromASTWalker(Context*
|
|||
|
||||
if (needToCaptureArguments) {
|
||||
ASSERT(argumentsObjectHolder->isKindOfFunction() && !argumentsObjectHolder->isArrowFunctionExpression());
|
||||
argumentsObjectHolder->captureArguments();
|
||||
// if argumentsObjectHolder and codeBlock are not same, arguments should be allocated on the heap
|
||||
argumentsObjectHolder->captureArguments(argumentsObjectHolder == codeBlock);
|
||||
|
||||
if (UNLIKELY(!codeBlock->isKindOfFunction() || codeBlock->isArrowFunctionExpression())) {
|
||||
InterpretedCodeBlock* p = codeBlock;
|
||||
|
|
@ -213,6 +213,9 @@ InterpretedCodeBlock* ScriptParser::generateCodeBlockTreeFromASTWalker(Context*
|
|||
ASSERT(p == argumentsObjectHolder);
|
||||
codeBlock->markHeapAllocatedEnvironmentFromHere(blockIndex, argumentsObjectHolder);
|
||||
}
|
||||
|
||||
// arguments captured, so continue to the next
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue