mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
re-implement arguments object binding
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
This commit is contained in:
parent
2661c971dc
commit
a85ee09334
10 changed files with 92 additions and 27 deletions
|
|
@ -56,10 +56,22 @@ CodeBlock* ScriptParser::generateCodeBlockTreeFromASTWalker(Context* ctx, String
|
|||
for (size_t i = 0; i < scopeCtx->m_usingNames.size(); i++) {
|
||||
AtomicString uname = scopeCtx->m_usingNames[i];
|
||||
if (uname == arguments) {
|
||||
codeBlock->m_usesArgumentsObject = true;
|
||||
if (!codeBlock->hasName(arguments)) {
|
||||
codeBlock->m_usesArgumentsObject = true;
|
||||
continue;
|
||||
CodeBlock::IdentifierInfo info;
|
||||
info.m_indexForIndexedStorage = SIZE_MAX;
|
||||
info.m_name = arguments;
|
||||
info.m_needToAllocateOnStack = false;
|
||||
codeBlock->m_identifierInfos.pushBack(info);
|
||||
} else {
|
||||
codeBlock->m_hasArgumentsBinding = true;
|
||||
}
|
||||
CodeBlock* b = codeBlock;
|
||||
while (b) {
|
||||
b->notifySelfOrChildHasEvalWithCatchYield();
|
||||
b = b->parentCodeBlock();
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (!codeBlock->hasName(uname)) {
|
||||
CodeBlock* c = codeBlock->parentCodeBlock();
|
||||
|
|
@ -72,7 +84,7 @@ CodeBlock* ScriptParser::generateCodeBlockTreeFromASTWalker(Context* ctx, String
|
|||
}
|
||||
}
|
||||
}
|
||||
// FIXME: modify efficiently if possible. consider 10.4.3-1-102-s
|
||||
|
||||
if (hasCapturedIdentifier) {
|
||||
CodeBlock* c = codeBlock->parentCodeBlock();
|
||||
while (c && c->m_canAllocateEnvironmentOnStack) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue