!10241 Fix arkuix bug

Merge pull request !10241 from 刘智杰/array_sort
This commit is contained in:
openharmony_ci 2024-11-15 04:09:10 +00:00 committed by Gitee
commit 4eebcebf46
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -1732,7 +1732,7 @@ JSTaggedValue JSStableArray::CopySortedListToReceiver(JSThread *thread, const JS
// 8. Repeat, while j < itemCount,
// a. Perform ! Set(obj, ! ToString((j)), sortedList[j], true).
// b. Set j to j + 1.
for (int j = 0; j < itemCount; j++) {
for (uint32_t j = 0; j < itemCount; j++) {
valueHandle.Update(sortedList->Get(j));
ElementAccessor::Set(thread, thisObj, j, valueHandle, needTransition);
}
@ -1742,7 +1742,7 @@ JSTaggedValue JSStableArray::CopySortedListToReceiver(JSThread *thread, const JS
// a. Perform ? DeletePropertyOrThrow(obj, ! ToString((j))).
// b. Set j to j + 1.
valueHandle.Update(JSTaggedValue::Hole());
for (int j = itemCount; j < len; j++) {
for (uint32_t j = itemCount; j < len; j++) {
ElementAccessor::Set(thread, thisObj, j, valueHandle, needTransition);
}
JSHandle<JSArray>::Cast(thisObj)->SetArrayLength(thread, newLength);