mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-11-27 04:00:37 +00:00
bugfix AddElementInternal
issue:I8HDRW Signed-off-by: dov1s <maojunwei1@huawei.com> Change-Id: I55aac24666922b95cbd973c112415c9a94ffd9ac
This commit is contained in:
parent
c4f04ac3b1
commit
52a4a9d7f9
@ -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());
|
||||
|
@ -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, ¬DicMode);
|
||||
Branch(IsDictionaryElement(hclass), &isDicMode, ¬DicMode);
|
||||
Bind(&isDicMode);
|
||||
{
|
||||
GateRef res = CallRuntime(glue, RTSTUB_ID(NumberDictionaryPut),
|
||||
|
@ -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]);
|
||||
}
|
@ -21,3 +21,8 @@ value 3
|
||||
4
|
||||
value 4
|
||||
5
|
||||
value 0
|
||||
value 1
|
||||
value 2
|
||||
undefined
|
||||
value 4
|
||||
|
Loading…
Reference in New Issue
Block a user