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:
seonghyun kim 2017-03-31 21:09:22 +09:00
commit ee1dcad092
20 changed files with 229 additions and 119 deletions

View file

@ -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();