mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-29 10:02:14 +00:00
Fix a bug in explicitly declared funtion name with exception case
* remove a redundant bytecode addition in node line info calculation Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
This commit is contained in:
parent
da449c8797
commit
79c3b4c73f
2 changed files with 2 additions and 23 deletions
|
|
@ -294,28 +294,7 @@ void ByteCodeGenerator::collectByteCodeLOCData(Context* context, InterpretedCode
|
|||
ctx.m_breakpointContext = &breakpointContext;
|
||||
#endif /* ESCARGOT_DEBUGGER */
|
||||
|
||||
// generate common codes
|
||||
{
|
||||
AtomicString name = codeBlock->functionName();
|
||||
if (name.string()->length()) {
|
||||
if (UNLIKELY(codeBlock->isFunctionNameExplicitlyDeclared())) {
|
||||
if (codeBlock->canUseIndexedVariableStorage()) {
|
||||
if (!codeBlock->isFunctionNameSaveOnHeap()) {
|
||||
auto r = ctx.getRegister();
|
||||
block.pushCode(LoadLiteral(ByteCodeLOC(0), r, Value()), &ctx, nullptr);
|
||||
block.pushCode(Move(ByteCodeLOC(0), r, REGULAR_REGISTER_LIMIT + 1), &ctx, nullptr);
|
||||
ctx.giveUpRegister();
|
||||
}
|
||||
}
|
||||
} else if (UNLIKELY(codeBlock->isFunctionNameSaveOnHeap() && !name.string()->equals("arguments"))) {
|
||||
ctx.m_isVarDeclaredBindingInitialization = true;
|
||||
IdentifierNode* id = new (alloca(sizeof(IdentifierNode))) IdentifierNode(codeBlock->functionName());
|
||||
id->generateStoreByteCode(&block, &ctx, REGULAR_REGISTER_LIMIT + 1, true);
|
||||
}
|
||||
}
|
||||
|
||||
ast->generateStatementByteCode(&block, &ctx);
|
||||
}
|
||||
ast->generateStatementByteCode(&block, &ctx);
|
||||
|
||||
// reset ASTAllocator
|
||||
context->astAllocator().reset();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue