handle the problem of compiling and reporting errors

Signed-off-by: hjzhangcm <zhanghaijun20@huawei.com>
This commit is contained in:
hjzhangcm 2022-02-22 17:52:13 +08:00
parent cf3ee3ab96
commit 59e9a47d29

View File

@ -312,7 +312,7 @@ JSTaggedValue JSAPIArrayList::ForEach(JSThread *thread, const JSHandle<JSTaggedV
JSTaggedValue funcResult =
JSFunction::Call(thread, callbackFn, thisArg, 3, arguments->GetArgv()); // 3: three args
RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, funcResult);
if (length != arrayList->GetSize()) {
if (static_cast<int>(length) != arrayList->GetSize()) {
length = arrayList->GetSize();
}
}