fix function's name setting

Signed-off-by: DaiHN <daihuina1@huawei.com>
This commit is contained in:
DaiHN 2021-09-17 09:50:12 +08:00
parent 10c1420fa9
commit af3be8f79c

View File

@ -739,6 +739,7 @@ JSTaggedValue SlowRuntimeStub::StOwnByName(JSThread *thread, JSTaggedValue obj,
}
return JSTaggedValue::True();
}
JSTaggedValue SlowRuntimeStub::StOwnByNameWithNameSet(JSThread *thread, JSTaggedValue obj, JSTaggedValue prop,
JSTaggedValue value)
{
@ -809,13 +810,9 @@ JSTaggedValue SlowRuntimeStub::StOwnByValue(JSThread *thread, JSTaggedValue obj,
if (!ret) {
return ThrowTypeError(thread, "StOwnByValue failed");
}
if (valueHandle->IsJSFunction()) {
if (propKey->IsNumber()) {
propKey.Update(base::NumberHelper::NumberToString(thread, propKey.GetTaggedValue()).GetTaggedValue());
}
}
return JSTaggedValue::True();
}
JSTaggedValue SlowRuntimeStub::StOwnByValueWithNameSet(JSThread *thread, JSTaggedValue obj, JSTaggedValue key,
JSTaggedValue value)
{
@ -853,6 +850,7 @@ JSTaggedValue SlowRuntimeStub::StOwnByValueWithNameSet(JSThread *thread, JSTagge
JSTaggedValue SlowRuntimeStub::CreateEmptyArray(JSThread *thread, ObjectFactory *factory, JSHandle<GlobalEnv> globalEnv)
{
[[maybe_unused]] EcmaHandleScope handleScope(thread);
JSHandle<JSFunction> builtinObj(globalEnv->GetArrayFunction());
JSHandle<JSObject> arr = factory->NewJSObjectByConstructor(builtinObj, JSHandle<JSTaggedValue>(builtinObj));
return arr.GetTaggedValue();