mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
Remove redundant parameter modules (#390)
* CodeBlock has essential parameter name list only * toString builtin function is fixed to use the entire source instead of body source * some TCs are fixed upto the spec Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
This commit is contained in:
parent
4a61f0f9b7
commit
cc3f7deb8c
12 changed files with 32 additions and 162 deletions
|
|
@ -213,29 +213,4 @@ void ScriptFunctionObject::generateArgumentsObject(ExecutionState& state, size_t
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ScriptFunctionObject::generateRestParameter(ExecutionState& state, FunctionEnvironmentRecord* record, Value* parameterStorageInStack, const size_t argc, Value* argv)
|
||||
{
|
||||
ArrayObject* newArray;
|
||||
size_t parameterLen = (size_t)m_codeBlock->parameterCount();
|
||||
|
||||
if (argc > parameterLen) {
|
||||
size_t arrLen = argc - parameterLen;
|
||||
newArray = new ArrayObject(state, (double)arrLen);
|
||||
for (size_t i = 0; i < arrLen; i++) {
|
||||
newArray->setIndexedProperty(state, Value(i), argv[parameterLen + i]);
|
||||
}
|
||||
} else {
|
||||
newArray = new ArrayObject(state);
|
||||
}
|
||||
|
||||
InterpretedCodeBlock::FunctionParametersInfo lastInfo = const_cast<InterpretedCodeBlock::FunctionParametersInfoVector&>(m_codeBlock->asInterpretedCodeBlock()->parametersInfomation()).back();
|
||||
if (!m_codeBlock->canUseIndexedVariableStorage()) {
|
||||
record->initializeBinding(state, lastInfo.m_name, Value(newArray));
|
||||
} else if (lastInfo.m_isHeapAllocated) {
|
||||
record->heapStorage()[lastInfo.m_index] = newArray;
|
||||
} else {
|
||||
parameterStorageInStack[lastInfo.m_index] = newArray;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue