1. not every binding is mutable in strict mode

- add m_isExplicitlyDeclaredOrParameterName into name info in ASTScopeContext
  - add m_isMutable into IdentifierRecord struct
  - add ThrowStaticExcpetion opcode in indexed-mode
  - add throw exception code in storeByName operation
2. when evaluate delete operation on member variable, must evaluate toString operation once for name even if exception throws
3. in strict mode, Decimals with leading zero literals are not allowed

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
This commit is contained in:
seonghyun kim 2017-03-22 22:33:22 +09:00
commit 35ceec9680
17 changed files with 172 additions and 105 deletions

View file

@ -89,6 +89,7 @@ CodeBlock* ScriptParser::generateCodeBlockTreeFromASTWalker(Context* ctx, String
info.m_indexForIndexedStorage = SIZE_MAX;
info.m_name = arguments;
info.m_needToAllocateOnStack = true;
info.m_isMutable = true;
codeBlock->m_identifierInfos.pushBack(info);
}
@ -211,8 +212,10 @@ ScriptParser::ScriptParserResult ScriptParser::parse(StringView scriptSource, St
PRINT_TAB()
printf("Names: ");
for (size_t i = 0; i < cb->m_identifierInfos.size(); i++) {
printf("%s(%s, %d), ", cb->m_identifierInfos[i].m_name.string()->toUTF8StringData().data(),
cb->m_identifierInfos[i].m_needToAllocateOnStack ? "Stack" : "Heap", (int)cb->m_identifierInfos[i].m_indexForIndexedStorage);
printf("%s(%s, %s, %d), ", cb->m_identifierInfos[i].m_name.string()->toUTF8StringData().data(),
cb->m_identifierInfos[i].m_needToAllocateOnStack ? "Stack" : "Heap",
cb->m_identifierInfos[i].m_isMutable ? "Mutable" : "Inmmutable",
(int)cb->m_identifierInfos[i].m_indexForIndexedStorage);
}
puts("");