bugfix AddElementInternal

issue:I8HDRW

Signed-off-by: dov1s <maojunwei1@huawei.com>
Change-Id: I55aac24666922b95cbd973c112415c9a94ffd9ac
This commit is contained in:
dov1s 2023-11-17 17:34:25 +08:00
parent c4f04ac3b1
commit 52a4a9d7f9
4 changed files with 16 additions and 2 deletions

View File

@ -248,7 +248,7 @@ GateRef NewObjectStubBuilder::ExtendArray(GateRef glue, GateRef elements, GateRe
Jump(&loopHead1);
LoopBegin(&loopHead1);
{
Branch(Int32UnsignedLessThan(*index, oldL), &storeValue1, &afterLoop1);
Branch(Int32UnsignedLessThan(*index, newLen), &storeValue1, &afterLoop1);
Bind(&storeValue1);
{
SetValueToTaggedArray(VariableType::JS_ANY(), glue, array, *index, Hole());

View File

@ -3039,7 +3039,7 @@ GateRef StubBuilder::AddElementInternal(GateRef glue, GateRef receiver, GateRef
GateRef elements = GetElementsArray(receiver);
Label isDicMode(env);
Label notDicMode(env);
Branch(IsDictionaryModeByHClass(hclass), &isDicMode, &notDicMode);
Branch(IsDictionaryElement(hclass), &isDicMode, &notDicMode);
Bind(&isDicMode);
{
GateRef res = CallRuntime(glue, RTSTUB_ID(NumberDictionaryPut),

View File

@ -31,3 +31,12 @@ for (let i = 0; i < 5; i++) {
print(arr1[i]);
print(arr2[i]);
}
let arr3 = {x: 1,y:3};
for (let i = 0; i < 5; i++) {
arr3[i] = `value ${i}`;
if (i ==3) delete arr3[i];
}
for (let i = 0; i < 5; i++) {
print(arr3[i]);
}

View File

@ -21,3 +21,8 @@ value 3
4
value 4
5
value 0
value 1
value 2
undefined
value 4