mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
1. revise DeclareFunctionExpression as CreateFunction
2. evalute function decl in catch correctly 3. give receiver of get, set in interpreter correctly 4. give right StackTrace information in with, try-catch for user 5. fix bug in argument object around get, set variable Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
This commit is contained in:
parent
61f1065a7f
commit
ee1dcad092
20 changed files with 229 additions and 119 deletions
|
|
@ -40,6 +40,12 @@ CodeBlock* ScriptParser::generateCodeBlockTreeFromASTWalker(Context* ctx, String
|
|||
| (scopeCtx->m_hasCatch ? CodeBlock::CodeBlockHasCatch : 0)
|
||||
| (scopeCtx->m_hasYield ? CodeBlock::CodeBlockHasYield : 0)));
|
||||
} else {
|
||||
bool isFE = scopeCtx->m_nodeType == FunctionExpression;
|
||||
bool isFD = scopeCtx->m_nodeType == FunctionDeclaration;
|
||||
|
||||
if (scopeCtx->m_needsSpecialInitialize)
|
||||
isFD = false;
|
||||
|
||||
codeBlock = new CodeBlock(ctx, script, StringView(source, scopeCtx->m_locStart.index, scopeCtx->m_locEnd.index),
|
||||
scopeCtx->m_locStart,
|
||||
scopeCtx->m_isStrict,
|
||||
|
|
@ -50,8 +56,9 @@ CodeBlock* ScriptParser::generateCodeBlockTreeFromASTWalker(Context* ctx, String
|
|||
| (scopeCtx->m_hasYield ? CodeBlock::CodeBlockHasYield : 0)
|
||||
| (scopeCtx->m_inCatch ? CodeBlock::CodeBlockInCatch : 0)
|
||||
| (scopeCtx->m_inWith ? CodeBlock::CodeBlockInWith : 0)
|
||||
| (scopeCtx->m_nodeType == FunctionExpression ? CodeBlock::CodeBlockIsFunctionExpression : 0)
|
||||
| (scopeCtx->m_nodeType == FunctionDeclaration ? CodeBlock::CodeBlockIsFunctionDeclaration : 0)));
|
||||
| (isFE ? CodeBlock::CodeBlockIsFunctionExpression : 0)
|
||||
| (isFD ? CodeBlock::CodeBlockIsFunctionDeclaration : 0)
|
||||
| (scopeCtx->m_needsSpecialInitialize ? CodeBlock::CodeBlockIsFunctionDeclarationWithSpecialBinding : 0)));
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
|
|
@ -61,7 +68,7 @@ CodeBlock* ScriptParser::generateCodeBlockTreeFromASTWalker(Context* ctx, String
|
|||
#endif
|
||||
|
||||
if (parentCodeBlock) {
|
||||
if (codeBlock->hasEvalWithCatchYield()) {
|
||||
if (codeBlock->hasEvalWithCatchYield() || codeBlock->isFunctionDeclarationWithSpecialBinding()) {
|
||||
CodeBlock* c = codeBlock;
|
||||
while (c) {
|
||||
c->notifySelfOrChildHasEvalWithCatchYield();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue