mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
Remove duplicated parameter-check methods
Signed-off-by: Hyukwoo Park <hyukwoo.park@jbnu.ac.kr>
This commit is contained in:
parent
6ebbd22c06
commit
989e6922b6
4 changed files with 5 additions and 15 deletions
|
|
@ -423,7 +423,7 @@ void InterpretedCodeBlock::recordFunctionParsingInfo(ASTScopeContext* scopeCtx,
|
|||
void InterpretedCodeBlock::captureArguments(bool needToAllocateOnStack)
|
||||
{
|
||||
AtomicString arguments = m_context->staticStrings().arguments;
|
||||
ASSERT(!hasParameterName(arguments));
|
||||
ASSERT(!isParameterName(arguments));
|
||||
ASSERT(!isGlobalCodeBlock() && !isArrowFunctionExpression() && isKindOfFunction());
|
||||
|
||||
if (m_usesArgumentsObject) {
|
||||
|
|
|
|||
|
|
@ -925,7 +925,7 @@ public:
|
|||
return findVarName(name) != SIZE_MAX;
|
||||
}
|
||||
|
||||
bool hasParameterName(const AtomicString& name)
|
||||
bool isParameterName(const AtomicString& name)
|
||||
{
|
||||
for (size_t i = 0; i < parameterNamesCount(); i++) {
|
||||
if (m_parameterNames[i] == name) {
|
||||
|
|
@ -935,16 +935,6 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
bool isParameterName(const AtomicString& name)
|
||||
{
|
||||
size_t r = findVarName(name);
|
||||
if (r != SIZE_MAX) {
|
||||
return m_identifierInfos[r].m_isParameterName;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void markHeapAllocatedEnvironmentFromHere(LexicalBlockIndex blockIndex = 0, InterpretedCodeBlock* to = nullptr);
|
||||
|
||||
void setConstructedObjectPropertyCount(size_t s)
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ InterpretedCodeBlock* ScriptParser::generateCodeBlockTreeFromASTWalker(Context*
|
|||
bool needToCaptureArguments = false;
|
||||
InterpretedCodeBlock* argumentsObjectHolder = codeBlock;
|
||||
while (argumentsObjectHolder && !argumentsObjectHolder->isGlobalCodeBlock()) {
|
||||
if (UNLIKELY(argumentsObjectHolder->hasParameterName(arguments))) {
|
||||
if (UNLIKELY(argumentsObjectHolder->isParameterName(arguments))) {
|
||||
// no need to create arguments object since it has a parameter of which name is `arguments`
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ public:
|
|||
context->addLexicallyDeclaredNames(m_name);
|
||||
}
|
||||
|
||||
if (context->m_inParameterInitialization && codeBlock->m_codeBlock->hasParameterName(m_name)) {
|
||||
if (context->m_inParameterInitialization && codeBlock->m_codeBlock->isParameterName(m_name)) {
|
||||
context->addInitializedParameterNames(m_name);
|
||||
}
|
||||
|
||||
|
|
@ -205,7 +205,7 @@ public:
|
|||
codeBlock->pushCode(EnsureArgumentsObject(ByteCodeLOC(m_loc.index)), context, this->m_loc.index);
|
||||
}
|
||||
|
||||
if (context->m_inParameterInitialization && codeBlock->m_codeBlock->hasParameterName(m_name)) {
|
||||
if (context->m_inParameterInitialization && codeBlock->m_codeBlock->isParameterName(m_name)) {
|
||||
addParameterReferenceErrorIfNeeds(codeBlock, context);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue