mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-11-23 10:09:54 +00:00
Fix assign bug
Issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/IB27BA Signed-off-by: xwcai98 <caixinwei5@huawei.com> Change-Id: Ibcf0b06d438c891739c3155ff390b025430ba21c
This commit is contained in:
parent
e688cee54e
commit
e1147688e1
@ -5826,7 +5826,7 @@ void StubBuilder::FastSetPropertyByName(GateRef glue, GateRef obj, GateRef key,
|
||||
}
|
||||
Bind(&slowPath);
|
||||
{
|
||||
result = CallRuntime(glue, RTSTUB_ID(StoreICByValue), { obj, *keyVar, value, IntToTaggedInt(Int32(0)) });
|
||||
result = CallRuntime(glue, RTSTUB_ID(StObjByValue), { obj, *keyVar, value });
|
||||
Jump(&exit);
|
||||
}
|
||||
Bind(&exit);
|
||||
|
@ -296,6 +296,7 @@ namespace panda::ecmascript {
|
||||
V(StOwnByValue) \
|
||||
V(LdSuperByValue) \
|
||||
V(StSuperByValue) \
|
||||
V(StObjByValue) \
|
||||
V(LdObjByIndex) \
|
||||
V(StObjByIndex) \
|
||||
V(StOwnByIndex) \
|
||||
|
@ -1369,6 +1369,15 @@ DEF_RUNTIME_STUBS(GetArrayLiteralFromCache)
|
||||
thread, cp, index.GetInt(), module.GetTaggedValue()).GetRawData();
|
||||
}
|
||||
|
||||
DEF_RUNTIME_STUBS(StObjByValue)
|
||||
{
|
||||
RUNTIME_STUBS_HEADER(StObjByValue);
|
||||
JSHandle<JSTaggedValue> receiver = GetHArg<JSTaggedValue>(argv, argc, 0); // 0: means the zeroth parameter
|
||||
JSHandle<JSTaggedValue> key = GetHArg<JSTaggedValue>(argv, argc, 1); // 1: means the first parameter
|
||||
JSHandle<JSTaggedValue> value = GetHArg<JSTaggedValue>(argv, argc, 2); // 2: means the second parameter
|
||||
return RuntimeStObjByValue(thread, receiver, key, value).GetRawData();
|
||||
}
|
||||
|
||||
DEF_RUNTIME_STUBS(LdObjByIndex)
|
||||
{
|
||||
RUNTIME_STUBS_HEADER(LdObjByIndex);
|
||||
|
@ -17,3 +17,4 @@
|
||||
3
|
||||
false
|
||||
a,b,c
|
||||
true
|
||||
|
@ -54,4 +54,16 @@ const v3 = 10;
|
||||
const v4 = Symbol("foo");
|
||||
|
||||
const obj3 = Object.assign({}, v1, null, v2, undefined, v3, v4);
|
||||
print(Object.values(obj3))
|
||||
print(Object.values(obj3));
|
||||
|
||||
const v5 = new Uint8Array();
|
||||
const o7 = {
|
||||
__proto__ : v5,
|
||||
};
|
||||
const o8 = {
|
||||
get f() {
|
||||
return this;
|
||||
},
|
||||
};
|
||||
Object.assign(o7, o8);
|
||||
print(o7.f === o8);
|
||||
|
Loading…
Reference in New Issue
Block a user