修复array的findIndex查找不到undefined元素下标的问题

https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I8D8UH

Signed-off-by: 杨云飞 <yangyunfei19@h-partners.com>
This commit is contained in:
杨云飞 2023-11-03 09:08:12 +08:00
parent 93400834ab
commit 87d5c49bdb

View File

@ -330,6 +330,9 @@ JSTaggedValue JSStableArray::HandleFindIndexOfStable(JSThread *thread, JSHandle<
// Elements of thisObjHandle may change.
array.Update(thisObjHandle->GetElements());
kValue.Update(array->Get(k));
if(kValue->IsHole()) {
kValue.Update(JSTaggedValue::Undefined());
}
EcmaRuntimeCallInfo *info =
EcmaInterpreter::NewRuntimeCallInfo(thread, callbackFnHandle, thisArgHandle, undefined, argsLength);
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);