mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-29 10:02:14 +00:00
Fix print error on ByteCodeGenerator
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
This commit is contained in:
parent
b1a3ccc12e
commit
795aa354f1
1 changed files with 1 additions and 4 deletions
|
|
@ -920,15 +920,12 @@ void ByteCodeGenerator::printByteCode(Context* context, ByteCodeBlock* block)
|
|||
}
|
||||
|
||||
size_t localStart = 0;
|
||||
if (codeBlock->isFunctionExpression() && !codeBlock->isFunctionNameSaveOnHeap()) {
|
||||
if (codeBlock->isFunctionNameSaveOnHeap() || codeBlock->isFunctionNameUsedBySelf()) {
|
||||
localStart = 1;
|
||||
}
|
||||
for (size_t i = localStart; i < codeBlock->identifierInfos().size(); i++) {
|
||||
if (codeBlock->identifierInfos()[i].m_needToAllocateOnStack) {
|
||||
auto name = codeBlock->identifierInfos()[i].m_name.string()->toNonGCUTF8StringData();
|
||||
if (i == 0 && codeBlock->isFunctionExpression()) {
|
||||
name += "(function name)";
|
||||
}
|
||||
printf("`r%d,var %s`,", (int)b++, name.data());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue