Add setName API of FunctionObject

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
This commit is contained in:
HyukWoo Park 2022-01-12 15:38:33 +09:00 committed by Patrick Kim
commit bd35e41168
17 changed files with 79 additions and 18 deletions

View file

@ -28,14 +28,14 @@ NativeFunctionObject::NativeFunctionObject(ExecutionState& state, const NativeFu
: FunctionObject(state, state.context()->globalObject()->functionPrototype(), info.m_isConstructor ? (ESCARGOT_OBJECT_BUILTIN_PROPERTY_NUMBER + 3) : (ESCARGOT_OBJECT_BUILTIN_PROPERTY_NUMBER + 2))
{
m_codeBlock = new NativeCodeBlock(state.context(), info);
initStructureAndValues(state, info.m_isConstructor, false, false);
initStructureAndValues(state, info.m_isConstructor, false);
}
NativeFunctionObject::NativeFunctionObject(ExecutionState& state, const NativeFunctionInfo& info, ForGlobalBuiltin)
: FunctionObject(state, state.context()->globalObject()->objectPrototype(), ESCARGOT_OBJECT_BUILTIN_PROPERTY_NUMBER + 2)
{
m_codeBlock = new NativeCodeBlock(state.context(), info);
initStructureAndValues(state, info.m_isConstructor, false, false);
initStructureAndValues(state, info.m_isConstructor, false);
ASSERT(!NativeFunctionObject::isConstructor());
}
@ -43,7 +43,7 @@ NativeFunctionObject::NativeFunctionObject(ExecutionState& state, const NativeFu
: FunctionObject(state, state.context()->globalObject()->functionPrototype(), info.m_isConstructor ? (ESCARGOT_OBJECT_BUILTIN_PROPERTY_NUMBER + 3) : (ESCARGOT_OBJECT_BUILTIN_PROPERTY_NUMBER + 2))
{
m_codeBlock = new NativeCodeBlock(state.context(), info);
initStructureAndValues(state, info.m_isConstructor, false, false);
initStructureAndValues(state, info.m_isConstructor, false);
if (info.m_isConstructor) {
m_structure = state.context()->defaultStructureForBuiltinFunctionObject();
}