Lines Matching full:thread
44 static JSFunction *JSObjectTestCreate(JSThread *thread) in JSObjectTestCreate() argument
46 JSHandle<GlobalEnv> globalEnv = thread->GetEcmaVM()->GetGlobalEnv(); in JSObjectTestCreate()
52 JSHandle<JSTaggedValue> objFunc(thread, JSObjectTestCreate(thread)); in HWTEST_F_L0()
54 …thread->GetEcmaVM()->GetFactory()->NewJSObjectByConstructor(JSHandle<JSFunction>(objFunc), objFunc… in HWTEST_F_L0()
60 JSHandle<JSTaggedValue> objFunc(thread, JSObjectTestCreate(thread)); in HWTEST_F_L0()
62 …thread->GetEcmaVM()->GetFactory()->NewJSObjectByConstructor(JSHandle<JSFunction>(objFunc), objFunc… in HWTEST_F_L0()
66 JSHandle<JSTaggedValue> key(thread->GetEcmaVM()->GetFactory()->NewFromASCII(array)); in HWTEST_F_L0()
67 JSHandle<JSTaggedValue> value(thread, JSTaggedValue(1)); in HWTEST_F_L0()
69 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(jsobject), key, value); in HWTEST_F_L0()
70 …EXPECT_EQ(JSObject::GetProperty(thread, JSHandle<JSTaggedValue>(jsobject), key).GetValue()->GetInt… in HWTEST_F_L0()
72 JSHandle<JSTaggedValue> value2(thread, JSTaggedValue(2)); in HWTEST_F_L0()
73 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(jsobject), key, value2); in HWTEST_F_L0()
74 …EXPECT_EQ(JSObject::GetProperty(thread, JSHandle<JSTaggedValue>(jsobject), key).GetValue()->GetInt… in HWTEST_F_L0()
79 JSHandle<JSTaggedValue> objFunc(thread, JSObjectTestCreate(thread)); in HWTEST_F_L0()
81 …thread->GetEcmaVM()->GetFactory()->NewJSObjectByConstructor(JSHandle<JSFunction>(objFunc), objFunc… in HWTEST_F_L0()
85 JSHandle<JSTaggedValue> key(thread->GetEcmaVM()->GetFactory()->NewFromASCII(array)); in HWTEST_F_L0()
86 JSHandle<JSTaggedValue> value(thread, JSTaggedValue(1)); in HWTEST_F_L0()
88 …EXPECT_TRUE(JSObject::GetProperty(thread, JSHandle<JSTaggedValue>(obj), key).GetValue()->IsUndefin… in HWTEST_F_L0()
90 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj), key, value); in HWTEST_F_L0()
91 …EXPECT_EQ(JSObject::GetProperty(thread, JSHandle<JSTaggedValue>(obj), key).GetValue()->GetInt(), 1… in HWTEST_F_L0()
96 JSHandle<JSTaggedValue> objFunc(thread, JSObjectTestCreate(thread)); in HWTEST_F_L0()
98 …thread->GetEcmaVM()->GetFactory()->NewJSObjectByConstructor(JSHandle<JSFunction>(objFunc), objFunc… in HWTEST_F_L0()
102 JSHandle<JSTaggedValue> key(thread->GetEcmaVM()->GetFactory()->NewFromASCII(array)); in HWTEST_F_L0()
103 JSHandle<JSTaggedValue> value(thread, JSTaggedValue(1)); in HWTEST_F_L0()
105 JSObject::DeleteProperty(thread, (obj), key); in HWTEST_F_L0()
106 …EXPECT_TRUE(JSObject::GetProperty(thread, JSHandle<JSTaggedValue>(obj), key).GetValue()->IsUndefin… in HWTEST_F_L0()
108 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj), key, value); in HWTEST_F_L0()
109 …EXPECT_EQ(JSObject::GetProperty(thread, JSHandle<JSTaggedValue>(obj), key).GetValue()->GetInt(), 1… in HWTEST_F_L0()
111 JSHandle<JSTaggedValue> key2(thread->GetEcmaVM()->GetFactory()->NewFromASCII("print_test")); in HWTEST_F_L0()
112 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj), key2, in HWTEST_F_L0()
113 JSHandle<JSTaggedValue>(thread, JSTaggedValue(10))); in HWTEST_F_L0()
114 …EXPECT_EQ(JSObject::GetProperty(thread, JSHandle<JSTaggedValue>(obj), key2).GetValue()->GetInt(), … in HWTEST_F_L0()
116 JSObject::DeleteProperty(thread, (obj), key); in HWTEST_F_L0()
117 …EXPECT_TRUE(JSObject::GetProperty(thread, JSHandle<JSTaggedValue>(obj), key).GetValue()->IsUndefin… in HWTEST_F_L0()
118 …EXPECT_EQ(JSObject::GetProperty(thread, JSHandle<JSTaggedValue>(obj), key2).GetValue()->GetInt(), … in HWTEST_F_L0()
123 JSHandle<GlobalEnv> globalEnv = thread->GetEcmaVM()->GetGlobalEnv(); in HWTEST_F_L0()
124 JSHandle<JSTaggedValue> global(thread, globalEnv->GetGlobalObject()); in HWTEST_F_L0()
125 JSHandle<JSTaggedValue> printKey(thread->GetEcmaVM()->GetFactory()->NewFromASCII("print")); in HWTEST_F_L0()
126 …JSHandle<JSTaggedValue> printTestKey(thread->GetEcmaVM()->GetFactory()->NewFromASCII("print_test")… in HWTEST_F_L0()
128 JSHandle<JSTaggedValue> value = JSObject::GetProperty(thread, global, printKey).GetValue(); in HWTEST_F_L0()
130 JSObject::SetProperty(thread, global, printTestKey, value); in HWTEST_F_L0()
132 …JSTaggedValue val2 = JSObject::GetProperty(thread, global, printTestKey).GetValue().GetTaggedValue… in HWTEST_F_L0()
134 JSTaggedValue::DeletePropertyOrThrow(thread, global, printTestKey); in HWTEST_F_L0()
135 … JSTaggedValue val3 = JSObject::GetProperty(thread, global, printKey).GetValue().GetTaggedValue(); in HWTEST_F_L0()
139 void GetPropertyHasOwnPeroperty(JSThread *thread, bool hasOwnProperty = false) in GetPropertyHasOwnPeroperty() argument
141 JSHandle<JSObject> nullHandle(thread, JSTaggedValue::Null()); in GetPropertyHasOwnPeroperty()
142 JSHandle<JSObject> grandfather = JSObject::ObjectCreate(thread, nullHandle); in GetPropertyHasOwnPeroperty()
143 JSHandle<JSObject> father = JSObject::ObjectCreate(thread, grandfather); in GetPropertyHasOwnPeroperty()
144 JSHandle<JSObject> son = JSObject::ObjectCreate(thread, father); in GetPropertyHasOwnPeroperty()
146 JSHandle<JSTaggedValue> sonKey(thread->GetEcmaVM()->GetFactory()->NewFromASCII("key1")); in GetPropertyHasOwnPeroperty()
147 JSHandle<JSTaggedValue> fatherKey(thread->GetEcmaVM()->GetFactory()->NewFromASCII("key2")); in GetPropertyHasOwnPeroperty()
148 JSHandle<JSTaggedValue> grandfatherKey(thread->GetEcmaVM()->GetFactory()->NewFromASCII("key3")); in GetPropertyHasOwnPeroperty()
149 JSHandle<JSTaggedValue> sonValue(thread, JSTaggedValue(1)); // 1 : value in GetPropertyHasOwnPeroperty()
150 JSHandle<JSTaggedValue> fatherValue(thread, JSTaggedValue(2)); // 2 : value in GetPropertyHasOwnPeroperty()
151 JSHandle<JSTaggedValue> grandfatherValue(thread, JSTaggedValue(3)); // 3 : value in GetPropertyHasOwnPeroperty()
153 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(son), sonKey, sonValue); in GetPropertyHasOwnPeroperty()
154 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(father), fatherKey, fatherValue); in GetPropertyHasOwnPeroperty()
155 …JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(grandfather), grandfatherKey, grandfatherVal… in GetPropertyHasOwnPeroperty()
158 … bool flag = JSTaggedValue::HasOwnProperty(thread, JSHandle<JSTaggedValue>::Cast(son), sonKey); in GetPropertyHasOwnPeroperty()
160 flag = JSTaggedValue::HasOwnProperty(thread, JSHandle<JSTaggedValue>::Cast(son), fatherKey); in GetPropertyHasOwnPeroperty()
162 … flag = JSTaggedValue::HasOwnProperty(thread, JSHandle<JSTaggedValue>::Cast(son), grandfatherKey); in GetPropertyHasOwnPeroperty()
166 … JSObject::GetProperty(thread, JSHandle<JSTaggedValue>(son), sonKey).GetValue().GetTaggedValue()); in GetPropertyHasOwnPeroperty()
168 …JSObject::GetProperty(thread, JSHandle<JSTaggedValue>(son), fatherKey).GetValue().GetTaggedValue()… in GetPropertyHasOwnPeroperty()
171 …JSObject::GetProperty(thread, JSHandle<JSTaggedValue>(son), grandfatherKey).GetValue().GetTaggedVa… in GetPropertyHasOwnPeroperty()
177 GetPropertyHasOwnPeroperty(thread); in HWTEST_F_L0()
182 JSHandle<JSTaggedValue> constructor(thread, JSObjectTestCreate(thread)); in HWTEST_F_L0()
184 …thread->GetEcmaVM()->GetFactory()->NewJSObjectByConstructor(JSHandle<JSFunction>(constructor), con… in HWTEST_F_L0()
186 …thread->GetEcmaVM()->GetFactory()->NewJSObjectByConstructor(JSHandle<JSFunction>(constructor), con… in HWTEST_F_L0()
188 JSHandle<JSTaggedValue> key1(thread->GetEcmaVM()->GetFactory()->NewFromASCII("key3")); in HWTEST_F_L0()
189 JSHandle<JSTaggedValue> key2(thread->GetEcmaVM()->GetFactory()->NewFromASCII("key3")); in HWTEST_F_L0()
191 JSHandle<JSTaggedValue> value1(thread, JSTaggedValue(1)); in HWTEST_F_L0()
192 JSHandle<JSTaggedValue> value2(thread, JSTaggedValue(2)); in HWTEST_F_L0()
195 PropertyDescriptor desc(thread); in HWTEST_F_L0()
198 JSObject::DefineOwnProperty(thread, obj1, key1, desc); in HWTEST_F_L0()
199 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj1), key1, value2); in HWTEST_F_L0()
200 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj2), key1, value1); in HWTEST_F_L0()
201 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj2), key1, value2); in HWTEST_F_L0()
202 …EXPECT_EQ(JSObject::GetProperty(thread, JSHandle<JSTaggedValue>(obj1), key1).GetValue().GetTaggedV… in HWTEST_F_L0()
204 …EXPECT_EQ(JSObject::GetProperty(thread, JSHandle<JSTaggedValue>(obj2), key1).GetValue().GetTaggedV… in HWTEST_F_L0()
208 PropertyDescriptor desc1(thread); in HWTEST_F_L0()
211 JSObject::DefineOwnProperty(thread, obj1, key2, desc1); in HWTEST_F_L0()
212 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj1), key2, value1); in HWTEST_F_L0()
213 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj2), key2, value1); in HWTEST_F_L0()
214 JSObject::DeleteProperty(thread, (obj1), key2); in HWTEST_F_L0()
215 JSObject::DeleteProperty(thread, (obj2), key2); in HWTEST_F_L0()
216 …EXPECT_EQ(JSObject::GetProperty(thread, JSHandle<JSTaggedValue>(obj1), key2).GetValue().GetTaggedV… in HWTEST_F_L0()
218 …EXPECT_EQ(JSObject::GetProperty(thread, JSHandle<JSTaggedValue>(obj2), key2).GetValue().GetTaggedV… in HWTEST_F_L0()
224 JSHandle<JSTaggedValue> objFunc(thread, JSObjectTestCreate(thread)); in HWTEST_F_L0()
226 …thread->GetEcmaVM()->GetFactory()->NewJSObjectByConstructor(JSHandle<JSFunction>(objFunc), objFunc… in HWTEST_F_L0()
230 JSHandle<JSTaggedValue> key(thread->GetEcmaVM()->GetFactory()->NewFromASCII(array)); in HWTEST_F_L0()
231 JSHandle<JSTaggedValue> value(thread, JSTaggedValue(1)); in HWTEST_F_L0()
233 bool success = JSObject::CreateDataProperty(thread, obj, key, value); in HWTEST_F_L0()
236 success = JSTaggedValue::HasOwnProperty(thread, JSHandle<JSTaggedValue>::Cast(obj), key); in HWTEST_F_L0()
239 PropertyDescriptor desc(thread); in HWTEST_F_L0()
240 success = JSObject::GetOwnProperty(thread, obj, key, desc); in HWTEST_F_L0()
249 JSHandle<JSTaggedValue> objFunc(thread, JSObjectTestCreate(thread)); in HWTEST_F_L0()
251 …thread->GetEcmaVM()->GetFactory()->NewJSObjectByConstructor(JSHandle<JSFunction>(objFunc), objFunc… in HWTEST_F_L0()
255 JSHandle<JSTaggedValue> key(thread->GetEcmaVM()->GetFactory()->NewFromASCII(array)); in HWTEST_F_L0()
256 JSHandle<JSTaggedValue> value(thread, JSTaggedValue(1)); in HWTEST_F_L0()
258 bool success = JSObject::CreateMethodProperty(thread, obj, key, value); in HWTEST_F_L0()
261 success = JSTaggedValue::HasOwnProperty(thread, JSHandle<JSTaggedValue>::Cast(obj), key); in HWTEST_F_L0()
264 PropertyDescriptor desc(thread); in HWTEST_F_L0()
265 success = JSObject::GetOwnProperty(thread, obj, key, desc); in HWTEST_F_L0()
274 JSHandle<JSTaggedValue> objFunc(thread, JSObjectTestCreate(thread)); in HWTEST_F_L0()
276 …thread->GetEcmaVM()->GetFactory()->NewJSObjectByConstructor(JSHandle<JSFunction>(objFunc), objFunc… in HWTEST_F_L0()
280 JSHandle<JSTaggedValue> key(thread->GetEcmaVM()->GetFactory()->NewFromASCII(array)); in HWTEST_F_L0()
282 …PropertyDescriptor desc1(thread, JSHandle<JSTaggedValue>(thread, JSTaggedValue(1)), true, true, tr… in HWTEST_F_L0()
283 …bool success = JSTaggedValue::DefinePropertyOrThrow(thread, JSHandle<JSTaggedValue>(obj), key, des… in HWTEST_F_L0()
285 PropertyDescriptor descRes1(thread); in HWTEST_F_L0()
286 success = JSObject::GetOwnProperty(thread, obj, key, descRes1); in HWTEST_F_L0()
293 PropertyDescriptor desc2(thread, false, true, true); in HWTEST_F_L0()
294 … success = JSTaggedValue::DefinePropertyOrThrow(thread, JSHandle<JSTaggedValue>(obj), key, desc2); in HWTEST_F_L0()
296 PropertyDescriptor descRes2(thread); in HWTEST_F_L0()
297 success = JSObject::GetOwnProperty(thread, obj, key, descRes2); in HWTEST_F_L0()
304 PropertyDescriptor desc3(thread); in HWTEST_F_L0()
308 … success = JSTaggedValue::DefinePropertyOrThrow(thread, JSHandle<JSTaggedValue>(obj), key, desc3); in HWTEST_F_L0()
310 PropertyDescriptor descRes3(thread); in HWTEST_F_L0()
311 success = JSObject::GetOwnProperty(thread, obj, key, descRes3); in HWTEST_F_L0()
318 PropertyDescriptor desc4(thread, JSHandle<JSTaggedValue>(thread, JSTaggedValue(2))); in HWTEST_F_L0()
319 … success = JSTaggedValue::DefinePropertyOrThrow(thread, JSHandle<JSTaggedValue>(obj), key, desc4); in HWTEST_F_L0()
325 JSHandle<JSTaggedValue> objFunc(thread, JSObjectTestCreate(thread)); in HWTEST_F_L0()
327 …thread->GetEcmaVM()->GetFactory()->NewJSObjectByConstructor(JSHandle<JSFunction>(objFunc), objFunc… in HWTEST_F_L0()
331 JSHandle<JSTaggedValue> key(thread->GetEcmaVM()->GetFactory()->NewFromASCII(array)); in HWTEST_F_L0()
332 JSHandle<JSTaggedValue> value(thread, JSTaggedValue(1)); in HWTEST_F_L0()
334 bool flag = JSObject::HasProperty(thread, obj, key); in HWTEST_F_L0()
337 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj), key, value); in HWTEST_F_L0()
338 flag = JSObject::HasProperty(thread, obj, key); in HWTEST_F_L0()
341 JSObject::DeleteProperty(thread, (obj), key); in HWTEST_F_L0()
342 flag = JSObject::HasProperty(thread, obj, key); in HWTEST_F_L0()
348 JSHandle<JSObject> nullHandle(thread, JSTaggedValue::Null()); in HWTEST_F_L0()
349 JSHandle<JSObject> grandfather = JSObject::ObjectCreate(thread, nullHandle); in HWTEST_F_L0()
350 JSHandle<JSObject> father = JSObject::ObjectCreate(thread, grandfather); in HWTEST_F_L0()
351 JSHandle<JSObject> son = JSObject::ObjectCreate(thread, father); in HWTEST_F_L0()
353 JSHandle<JSTaggedValue> testGrand(thread, in HWTEST_F_L0()
354 JSTaggedValue::GetPrototype(thread, JSHandle<JSTaggedValue>(grandfather))); in HWTEST_F_L0()
355 …JSHandle<JSTaggedValue> testFather(thread, JSTaggedValue::GetPrototype(thread, JSHandle<JSTaggedVa… in HWTEST_F_L0()
356 …JSHandle<JSTaggedValue> testSon(thread, JSTaggedValue::GetPrototype(thread, JSHandle<JSTaggedValue… in HWTEST_F_L0()
359 JSHandle<JSTaggedValue> sonKey(thread->GetEcmaVM()->GetFactory()->NewFromASCII("key1")); in HWTEST_F_L0()
360 JSHandle<JSTaggedValue> fatherKey(thread->GetEcmaVM()->GetFactory()->NewFromASCII("key2")); in HWTEST_F_L0()
361 JSHandle<JSTaggedValue> grandfatherKey(thread->GetEcmaVM()->GetFactory()->NewFromASCII("key3")); in HWTEST_F_L0()
362 JSHandle<JSTaggedValue> sonValue(thread, JSTaggedValue(1)); in HWTEST_F_L0()
363 JSHandle<JSTaggedValue> fatherValue(thread, JSTaggedValue(2)); in HWTEST_F_L0()
364 JSHandle<JSTaggedValue> grandfatherValue(thread, JSTaggedValue(3)); in HWTEST_F_L0()
366 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(son), sonKey, sonValue); in HWTEST_F_L0()
367 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(father), fatherKey, fatherValue); in HWTEST_F_L0()
368 …JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(grandfather), grandfatherKey, grandfatherVal… in HWTEST_F_L0()
370 bool flag = JSObject::HasProperty(thread, son, sonKey); in HWTEST_F_L0()
372 flag = JSObject::HasProperty(thread, son, fatherKey); in HWTEST_F_L0()
374 flag = JSObject::HasProperty(thread, son, grandfatherKey); in HWTEST_F_L0()
380 GetPropertyHasOwnPeroperty(thread, true); in HWTEST_F_L0()
385 JSHandle<JSTaggedValue> constructor(thread, JSObjectTestCreate(thread)); in HWTEST_F_L0()
387 …thread->GetEcmaVM()->GetFactory()->NewJSObjectByConstructor(JSHandle<JSFunction>(constructor), con… in HWTEST_F_L0()
389 JSHandle<JSTaggedValue> key1(thread->GetEcmaVM()->GetFactory()->NewFromASCII("x")); in HWTEST_F_L0()
390 JSHandle<JSTaggedValue> key2(thread->GetEcmaVM()->GetFactory()->NewFromASCII("y")); in HWTEST_F_L0()
391 JSHandle<JSTaggedValue> key3(thread->GetEcmaVM()->GetFactory()->NewFromASCII("3")); in HWTEST_F_L0()
392 JSHandle<JSTaggedValue> key4(thread->GetEcmaVM()->GetFactory()->NewFromASCII("4")); in HWTEST_F_L0()
393 JSHandle<JSTaggedValue> value1(thread, JSTaggedValue(1)); in HWTEST_F_L0()
394 JSHandle<JSTaggedValue> value2(thread, JSTaggedValue(2)); in HWTEST_F_L0()
395 JSHandle<JSTaggedValue> value3(thread, JSTaggedValue(3)); in HWTEST_F_L0()
396 JSHandle<JSTaggedValue> value4(thread, JSTaggedValue(4)); in HWTEST_F_L0()
398 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj), key1, value1); in HWTEST_F_L0()
399 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj), key2, value2); in HWTEST_F_L0()
400 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj), key3, value3); in HWTEST_F_L0()
401 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj), key4, value4); in HWTEST_F_L0()
403 JSHandle<TaggedArray> array = JSObject::GetOwnPropertyKeys(thread, obj); in HWTEST_F_L0()
408 JSHandle<JSTaggedValue> key(thread, array->Get(i)); in HWTEST_F_L0()
409 … sum += JSObject::GetProperty(thread, JSHandle<JSTaggedValue>(obj), key).GetValue()->GetInt(); in HWTEST_F_L0()
416 JSHandle<JSObject> nullHandle(thread, JSTaggedValue::Null()); in HWTEST_F_L0()
417 JSHandle<JSObject> grandfather = JSObject::ObjectCreate(thread, nullHandle); in HWTEST_F_L0()
418 JSHandle<JSObject> father = JSObject::ObjectCreate(thread, grandfather); in HWTEST_F_L0()
419 JSHandle<JSObject> son = JSObject::ObjectCreate(thread, father); in HWTEST_F_L0()
421 …EXPECT_EQ(JSTaggedValue::GetPrototype(thread, JSHandle<JSTaggedValue>(son)), father.GetTaggedValue… in HWTEST_F_L0()
422 …EXPECT_EQ(JSTaggedValue::GetPrototype(thread, JSHandle<JSTaggedValue>(father)), grandfather.GetTag… in HWTEST_F_L0()
423 …EXPECT_EQ(JSTaggedValue::GetPrototype(thread, JSHandle<JSTaggedValue>(grandfather)), JSTaggedValue… in HWTEST_F_L0()
428 JSHandle<JSObject> nullHandle(thread, JSTaggedValue::Null()); in HWTEST_F_L0()
429 JSHandle<JSObject> obj = JSObject::ObjectCreate(thread, nullHandle); in HWTEST_F_L0()
430 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in HWTEST_F_L0()
431 JSHandle<JSTaggedValue> func(thread->GetEcmaVM()->GetFactory()->NewJSFunction(env)); in HWTEST_F_L0()
434 JSHandle<JSTaggedValue> key(thread->GetEcmaVM()->GetFactory()->NewFromASCII("1")); in HWTEST_F_L0()
435 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj), key, func); in HWTEST_F_L0()
436 …EXPECT_EQ(JSObject::GetProperty(thread, JSHandle<JSTaggedValue>(obj), key).GetValue().GetTaggedVal… in HWTEST_F_L0()
442 JSHandle<JSTaggedValue> objFunc(thread, JSObjectTestCreate(thread)); in HWTEST_F_L0()
444 …thread->GetEcmaVM()->GetFactory()->NewJSObjectByConstructor(JSHandle<JSFunction>(objFunc), objFunc… in HWTEST_F_L0()
448 JSHandle<EcmaString> tagString = thread->GetEcmaVM()->GetFactory()->NewFromASCII(&tagCStr[0]); in HWTEST_F_L0()
451 JSHandle<JSTaggedValue> value(thread, JSTaggedValue(1)); in HWTEST_F_L0()
453 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj), key, value); in HWTEST_F_L0()
454 …EXPECT_EQ(JSObject::GetProperty(thread, JSHandle<JSTaggedValue>(obj), key).GetValue()->GetInt(), 1… in HWTEST_F_L0()
456 JSHandle<TaggedArray> names = JSObject::EnumerableOwnNames(thread, obj); in HWTEST_F_L0()
458 JSHandle<JSTaggedValue> keyFromNames(thread, JSTaggedValue(names->Get(0))); in HWTEST_F_L0()
459 …EXPECT_EQ(JSObject::GetProperty(thread, JSHandle<JSTaggedValue>(obj), keyFromNames).GetValue()->Ge… in HWTEST_F_L0()
461 PropertyDescriptor descNoEnum(thread); in HWTEST_F_L0()
463 JSTaggedValue::DefinePropertyOrThrow(thread, JSHandle<JSTaggedValue>(obj), key, descNoEnum); in HWTEST_F_L0()
464 …EXPECT_EQ(JSObject::GetProperty(thread, JSHandle<JSTaggedValue>(obj), key).GetValue()->GetInt(), 1… in HWTEST_F_L0()
466 JSHandle<TaggedArray> namesNoEnum = JSObject::EnumerableOwnNames(thread, obj); in HWTEST_F_L0()
469 PropertyDescriptor descEnum(thread); in HWTEST_F_L0()
472 JSTaggedValue::DefinePropertyOrThrow(thread, JSHandle<JSTaggedValue>(obj), key, descEnum); in HWTEST_F_L0()
473 …EXPECT_EQ(JSObject::GetProperty(thread, JSHandle<JSTaggedValue>(obj), key).GetValue()->GetInt(), 1… in HWTEST_F_L0()
475 JSHandle<TaggedArray> namesNoConfig = JSObject::EnumerableOwnNames(thread, obj); in HWTEST_F_L0()
477 JSHandle<JSTaggedValue> keyNoConfig(thread, JSTaggedValue(namesNoConfig->Get(0))); in HWTEST_F_L0()
478 …EXPECT_EQ(JSObject::GetProperty(thread, JSHandle<JSTaggedValue>(obj), keyNoConfig).GetValue()->Get… in HWTEST_F_L0()
483 JSHandle<JSTaggedValue> hclass1(thread, JSObjectTestCreate(thread)); in HWTEST_F_L0()
485 …thread->GetEcmaVM()->GetFactory()->NewJSObjectByConstructor(JSHandle<JSFunction>(hclass1), hclass1… in HWTEST_F_L0()
488 … JSHandle<JSTaggedValue> key1(thread->GetEcmaVM()->GetFactory()->NewFromASCII(&undefinedCStr[0])); in HWTEST_F_L0()
489 JSHandle<JSTaggedValue> value1(thread, JSTaggedValue(1)); in HWTEST_F_L0()
490 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj1), key1, value1); in HWTEST_F_L0()
494 bool status1 = JSObject::SetIntegrityLevel(thread, jsobject, IntegrityLevel::SEALED); in HWTEST_F_L0()
496 …EXPECT_EQ(JSObject::GetProperty(thread, JSHandle<JSTaggedValue>(obj1), key1).GetValue().GetTaggedV… in HWTEST_F_L0()
498 PropertyDescriptor desc1(thread); in HWTEST_F_L0()
499 bool success1 = JSObject::GetOwnProperty(thread, jsobject, key1, desc1); in HWTEST_F_L0()
508 JSHandle<JSTaggedValue> hclass1(thread, JSObjectTestCreate(thread)); in HWTEST_F_L0()
510 …thread->GetEcmaVM()->GetFactory()->NewJSObjectByConstructor(JSHandle<JSFunction>(hclass1), hclass1… in HWTEST_F_L0()
514 … JSHandle<JSTaggedValue> key1(thread->GetEcmaVM()->GetFactory()->NewFromASCII(&undefinedCStr[0])); in HWTEST_F_L0()
515 JSHandle<JSTaggedValue> value1(thread, JSTaggedValue(1)); in HWTEST_F_L0()
516 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj1), key1, value1); in HWTEST_F_L0()
519 bool status1 = JSObject::SetIntegrityLevel(thread, obj1, IntegrityLevel::FROZEN); in HWTEST_F_L0()
521 …EXPECT_EQ(JSObject::GetProperty(thread, JSHandle<JSTaggedValue>(obj1), key1).GetValue().GetTaggedV… in HWTEST_F_L0()
523 PropertyDescriptor desc1(thread); in HWTEST_F_L0()
524 bool success1 = JSObject::GetOwnProperty(thread, obj1, key1, desc1); in HWTEST_F_L0()
533 JSHandle<JSTaggedValue> hclass1(thread, JSObjectTestCreate(thread)); in HWTEST_F_L0()
535 …thread->GetEcmaVM()->GetFactory()->NewJSObjectByConstructor(JSHandle<JSFunction>(hclass1), hclass1… in HWTEST_F_L0()
537 … JSHandle<JSTaggedValue> key1(thread->GetEcmaVM()->GetFactory()->NewFromASCII(&undefinedCStr[0])); in HWTEST_F_L0()
538 JSHandle<JSTaggedValue> value1(thread, JSTaggedValue(1)); in HWTEST_F_L0()
539 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj1), key1, value1); in HWTEST_F_L0()
543 bool status1 = JSObject::SetIntegrityLevel(thread, obj1, IntegrityLevel::SEALED); in HWTEST_F_L0()
545 …EXPECT_EQ(JSObject::GetProperty(thread, JSHandle<JSTaggedValue>(obj1), key1).GetValue().GetTaggedV… in HWTEST_F_L0()
548 PropertyDescriptor desc1(thread); in HWTEST_F_L0()
549 bool success1 = JSObject::GetOwnProperty(thread, obj1, key1, desc1); in HWTEST_F_L0()
551 EXPECT_EQ(true, JSObject::TestIntegrityLevel(thread, obj1, IntegrityLevel::SEALED)); in HWTEST_F_L0()
552 EXPECT_EQ(false, JSObject::TestIntegrityLevel(thread, obj1, IntegrityLevel::FROZEN)); in HWTEST_F_L0()
557 JSHandle<JSTaggedValue> hclass1(thread, JSObjectTestCreate(thread)); in HWTEST_F_L0()
559 …thread->GetEcmaVM()->GetFactory()->NewJSObjectByConstructor(JSHandle<JSFunction>(hclass1), hclass1… in HWTEST_F_L0()
561 … JSHandle<JSTaggedValue> key1(thread->GetEcmaVM()->GetFactory()->NewFromASCII(&undefinedCStr[0])); in HWTEST_F_L0()
562 JSHandle<JSTaggedValue> value1(thread, JSTaggedValue(1)); in HWTEST_F_L0()
563 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj1), key1, value1); in HWTEST_F_L0()
567 bool status1 = JSObject::SetIntegrityLevel(thread, obj1, IntegrityLevel::FROZEN); in HWTEST_F_L0()
569 …EXPECT_EQ(JSObject::GetProperty(thread, JSHandle<JSTaggedValue>(obj1), key1).GetValue().GetTaggedV… in HWTEST_F_L0()
572 PropertyDescriptor desc1(thread); in HWTEST_F_L0()
573 bool success1 = JSObject::GetOwnProperty(thread, obj1, key1, desc1); in HWTEST_F_L0()
575 EXPECT_EQ(true, JSObject::TestIntegrityLevel(thread, obj1, IntegrityLevel::SEALED)); in HWTEST_F_L0()
576 EXPECT_EQ(true, JSObject::TestIntegrityLevel(thread, obj1, IntegrityLevel::FROZEN)); in HWTEST_F_L0()
581 JSHandle<JSTaggedValue> hclass1(thread, JSObjectTestCreate(thread)); in HWTEST_F_L0()
583 …thread->GetEcmaVM()->GetFactory()->NewJSObjectByConstructor(JSHandle<JSFunction>(hclass1), hclass1… in HWTEST_F_L0()
586 … JSHandle<JSTaggedValue> key1(thread->GetEcmaVM()->GetFactory()->NewFromASCII(&undefinedCStr[0])); in HWTEST_F_L0()
590 bool status1 = JSObject::SetIntegrityLevel(thread, jsobject, IntegrityLevel::SEALED); in HWTEST_F_L0()
593 PropertyDescriptor desc1(thread); in HWTEST_F_L0()
594 bool success1 = JSObject::GetOwnProperty(thread, jsobject, key1, desc1); in HWTEST_F_L0()
596 EXPECT_EQ(true, JSObject::TestIntegrityLevel(thread, jsobject, IntegrityLevel::SEALED)); in HWTEST_F_L0()
597 EXPECT_EQ(true, JSObject::TestIntegrityLevel(thread, jsobject, IntegrityLevel::FROZEN)); in HWTEST_F_L0()
602 auto thread = argv->GetThread(); in TestGetter() local
603 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in TestGetter()
606 …JSTaggedValue value = JSObject::GetProperty(thread, JSHandle<JSTaggedValue>(obj), key).GetValue().… in TestGetter()
613 JSHandle<JSTaggedValue> hclass1(thread, JSObjectTestCreate(thread)); in HWTEST_F_L0()
614 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in HWTEST_F_L0()
618 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in HWTEST_F_L0()
620 thread->GetEcmaVM()->GetFactory()->NewJSFunction(env, reinterpret_cast<void *>(TestGetter)); in HWTEST_F_L0()
622 PropertyDescriptor desc1(thread); in HWTEST_F_L0()
624 bool success1 = JSObject::DefineOwnProperty(thread, obj, key1, desc1); in HWTEST_F_L0()
627 PropertyDescriptor desc2(thread); in HWTEST_F_L0()
628 desc2.SetValue(JSHandle<JSTaggedValue>(thread, JSTaggedValue(1))); in HWTEST_F_L0()
629 success1 = JSObject::DefineOwnProperty(thread, obj, key2, desc2); in HWTEST_F_L0()
632 …EXPECT_EQ(JSObject::GetProperty(thread, JSHandle<JSTaggedValue>(obj), key1).GetValue().GetTaggedVa… in HWTEST_F_L0()
638 JSThread *thread = argv->GetThread(); in TestSetter() local
639 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in TestSetter()
642 …JSTaggedValue value(JSObject::GetProperty(thread, JSHandle<JSTaggedValue>(obj), key).GetValue().Ge… in TestSetter()
643 JSHandle<JSTaggedValue> valueHandle(thread, JSTaggedValue(value.GetInt() + 1)); in TestSetter()
644 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj), key, valueHandle); in TestSetter()
651 JSHandle<JSTaggedValue> hclass1(thread, JSObjectTestCreate(thread)); in HWTEST_F_L0()
652 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in HWTEST_F_L0()
656 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in HWTEST_F_L0()
658 thread->GetEcmaVM()->GetFactory()->NewJSFunction(env, reinterpret_cast<void *>(TestSetter)); in HWTEST_F_L0()
660 PropertyDescriptor desc1(thread); in HWTEST_F_L0()
662 bool success1 = JSObject::DefineOwnProperty(thread, obj, key1, desc1); in HWTEST_F_L0()
665 …PropertyDescriptor desc2(thread, JSHandle<JSTaggedValue>(thread, JSTaggedValue(1)), true, true, tr… in HWTEST_F_L0()
666 success1 = JSObject::DefineOwnProperty(thread, obj, key2, desc2); in HWTEST_F_L0()
669 JSHandle<JSTaggedValue> valueHandle(thread, JSTaggedValue::Undefined()); in HWTEST_F_L0()
670 EXPECT_TRUE(JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj), key1, valueHandle)); in HWTEST_F_L0()
671 …EXPECT_EQ(JSObject::GetProperty(thread, JSHandle<JSTaggedValue>(obj), key2).GetValue().GetTaggedVa… in HWTEST_F_L0()
677 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in HWTEST_F_L0()
678 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in HWTEST_F_L0()
679 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in HWTEST_F_L0()
684 JSFunction::NewJSFunctionPrototype(thread, constructorFunc); in HWTEST_F_L0()
686 JSHandle<JSObject> nullHandle(thread, JSTaggedValue::Null()); in HWTEST_F_L0()
687 JSHandle<JSTaggedValue> undefinedValue(thread, JSTaggedValue::Undefined()); in HWTEST_F_L0()
688 JSHandle<JSObject> protoObj = JSObject::ObjectCreate(thread, nullHandle); in HWTEST_F_L0()
692 JSObject::SetProperty(thread, protoObjValue, constructorKey, constructorFuncValue); in HWTEST_F_L0()
699 JSFunction::MakeConstructor(thread, speciesConstruct, undefinedValue); in HWTEST_F_L0()
702 JSObject::SetProperty(thread, constructorFuncValue, speciesSymbol, speciesConstructValue); in HWTEST_F_L0()
705 JSObject::SpeciesConstructor(thread, protoObj, constructorFuncValue).GetTaggedValue(); in HWTEST_F_L0()
721 JSHandle<JSObject> GetterOrSetterIsUndefined(JSThread *thread, JSHandle<JSTaggedValue>& key) in GetterOrSetterIsUndefined() argument
723 JSHandle<JSTaggedValue> hclass1(thread, JSObjectTestCreate(thread)); in GetterOrSetterIsUndefined()
724 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in GetterOrSetterIsUndefined()
727 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in GetterOrSetterIsUndefined()
729 …thread->GetEcmaVM()->GetFactory()->NewJSFunction(env, reinterpret_cast<void *>(TestUndefinedGetter… in GetterOrSetterIsUndefined()
731 …thread->GetEcmaVM()->GetFactory()->NewJSFunction(env, reinterpret_cast<void *>(TestUndefinedSetter… in GetterOrSetterIsUndefined()
733 PropertyDescriptor desc1(thread); in GetterOrSetterIsUndefined()
738 bool success1 = JSObject::DefineOwnProperty(thread, obj, key, desc1); in GetterOrSetterIsUndefined()
745 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in HWTEST_F_L0()
746 JSHandle<JSTaggedValue> unGetter(thread, JSTaggedValue::Undefined()); in HWTEST_F_L0()
748 auto obj = GetterOrSetterIsUndefined(thread, key); in HWTEST_F_L0()
749 PropertyDescriptor desc2(thread); in HWTEST_F_L0()
751 bool success2 = JSObject::DefineOwnProperty(thread, obj, key, desc2); in HWTEST_F_L0()
754 PropertyDescriptor desc(thread); in HWTEST_F_L0()
755 bool success = JSObject::GetOwnProperty(thread, obj, key, desc); in HWTEST_F_L0()
763 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in HWTEST_F_L0()
764 JSHandle<JSTaggedValue> unSetter(thread, JSTaggedValue::Undefined()); in HWTEST_F_L0()
766 auto obj = GetterOrSetterIsUndefined(thread, key); in HWTEST_F_L0()
767 PropertyDescriptor desc2(thread); in HWTEST_F_L0()
769 bool success2 = JSObject::DefineOwnProperty(thread, obj, key, desc2); in HWTEST_F_L0()
772 PropertyDescriptor desc(thread); in HWTEST_F_L0()
773 bool success = JSObject::GetOwnProperty(thread, obj, key, desc); in HWTEST_F_L0()
777 …EXPECT_EQ(JSObject::GetProperty(thread, JSHandle<JSTaggedValue>(obj), key).GetValue().GetTaggedVal… in HWTEST_F_L0()
783 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in HWTEST_F_L0()
784 JSHandle<JSTaggedValue> objFunc(thread, JSObjectTestCreate(thread)); in HWTEST_F_L0()
788 JSHandle<JSHClass> hc1(thread, obj1->GetJSHClass()); in HWTEST_F_L0()
789 JSHandle<JSHClass> hc2(thread, obj2->GetJSHClass()); in HWTEST_F_L0()
794 JSHandle<JSTaggedValue> value(thread, JSTaggedValue(1)); in HWTEST_F_L0()
797 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj1), key1, value); in HWTEST_F_L0()
798 JSHandle<JSHClass> hc3(thread, obj1->GetJSHClass()); in HWTEST_F_L0()
801 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj2), key1, value); in HWTEST_F_L0()
802 JSHandle<JSHClass> hc4(thread, obj2->GetJSHClass()); in HWTEST_F_L0()
806 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj1), key2, value); in HWTEST_F_L0()
807 JSHandle<JSHClass> hc5(thread, obj1->GetJSHClass()); in HWTEST_F_L0()
810 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj2), key2, value); in HWTEST_F_L0()
811 JSHandle<JSHClass> hc6(thread, obj2->GetJSHClass()); in HWTEST_F_L0()
817 auto ecmaVM = thread->GetEcmaVM(); in HWTEST_F_L0()
820 JSHandle<JSTaggedValue> objFunc(thread, JSObjectTestCreate(thread)); in HWTEST_F_L0()
823 JSMutableHandle<EcmaString> key(thread, factory->NewFromASCII("x")); in HWTEST_F_L0()
824 JSMutableHandle<JSTaggedValue> number(thread, JSTaggedValue(0)); in HWTEST_F_L0()
825 JSMutableHandle<JSTaggedValue> newkey(thread, JSTaggedValue(0)); in HWTEST_F_L0()
826 JSHandle<JSTaggedValue> value(thread, JSTaggedValue(1)); in HWTEST_F_L0()
831 number.Update(JSTaggedValue::ToString(thread, number).GetTaggedValue()); in HWTEST_F_L0()
832 … EcmaString *newString = *factory->ConcatFromString(key, JSTaggedValue::ToString(thread, number)); in HWTEST_F_L0()
834 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj1), newkey, value); in HWTEST_F_L0()
841 number.Update(JSTaggedValue::ToString(thread, number).GetTaggedValue()); in HWTEST_F_L0()
842 … EcmaString *newString = *factory->ConcatFromString(key, JSTaggedValue::ToString(thread, number)); in HWTEST_F_L0()
844 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj1), newkey, value); in HWTEST_F_L0()
849 EXPECT_EQ(dict->NextEnumerationIndex(thread), in HWTEST_F_L0()
855 auto ecmaVM = thread->GetEcmaVM(); in HWTEST_F_L0()
858 JSHandle<JSTaggedValue> objFunc(thread, JSObjectTestCreate(thread)); in HWTEST_F_L0()
861 JSMutableHandle<EcmaString> key(thread, factory->NewFromASCII("x")); in HWTEST_F_L0()
862 JSMutableHandle<JSTaggedValue> number(thread, JSTaggedValue(0)); in HWTEST_F_L0()
863 JSMutableHandle<JSTaggedValue> newkey(thread, JSTaggedValue(0)); in HWTEST_F_L0()
864 JSHandle<JSTaggedValue> value(thread, JSTaggedValue(1)); in HWTEST_F_L0()
868 number.Update(JSTaggedValue::ToString(thread, number).GetTaggedValue()); in HWTEST_F_L0()
869 … EcmaString *newString = *factory->ConcatFromString(key, JSTaggedValue::ToString(thread, number)); in HWTEST_F_L0()
871 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj1), newkey, value); in HWTEST_F_L0()
876 JSMutableHandle<JSTaggedValue> key5(thread, factory->NewFromASCII("x5")); in HWTEST_F_L0()
877 JSObject::DeleteProperty(thread, (obj1), key5); in HWTEST_F_L0()
882 EXPECT_FALSE(JSObject::HasProperty(thread, obj1, key5)); in HWTEST_F_L0()
887 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in HWTEST_F_L0()
888 JSHandle<JSTaggedValue> objFunc(thread, JSObjectTestCreate(thread)); in HWTEST_F_L0()
889 JSHandle<JSTaggedValue> key0(thread, JSTaggedValue(0)); in HWTEST_F_L0()
890 JSHandle<JSTaggedValue> key1(thread, JSTaggedValue(1)); in HWTEST_F_L0()
891 JSHandle<JSTaggedValue> key2(thread, JSTaggedValue(2)); in HWTEST_F_L0()
892 JSHandle<JSTaggedValue> key2000(thread, JSTaggedValue(2000)); in HWTEST_F_L0()
898 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj1), keyStr, key2); in HWTEST_F_L0()
899 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj1), key0, key0); in HWTEST_F_L0()
901 JSHandle<JSHClass> hclass(thread, obj1->GetJSHClass()); in HWTEST_F_L0()
902 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj1), key1, key1); in HWTEST_F_L0()
906 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj1), key2000, key2000); in HWTEST_F_L0()
909 … JSObject::GetProperty(thread, JSHandle<JSTaggedValue>(obj1), keyStr).GetValue().GetTaggedValue(); in HWTEST_F_L0()
913 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj2), key0, key0); in HWTEST_F_L0()
915 JSHandle<JSHClass> hclass2(thread, obj2->GetJSHClass()); in HWTEST_F_L0()
916 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj2), key2, key2); in HWTEST_F_L0()
921 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj3), key0, key0); in HWTEST_F_L0()
922 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj3), key1, key1); in HWTEST_F_L0()
923 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj3), key2, key2); in HWTEST_F_L0()
925 PropertyDescriptor desc(thread); in HWTEST_F_L0()
928 JSObject::DefineOwnProperty(thread, obj3, key1, desc); in HWTEST_F_L0()
932 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj4), key0, key0); in HWTEST_F_L0()
933 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj4), key1, key1); in HWTEST_F_L0()
934 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj4), key2, key2); in HWTEST_F_L0()
937 JSHandle<JSTaggedValue> value1001(thread, JSTaggedValue(1001)); in HWTEST_F_L0()
939 PropertyDescriptor desc1(thread); in HWTEST_F_L0()
944 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj100), key0, key1); in HWTEST_F_L0()
945 JSObject::DefineOwnProperty(thread, obj100, key0, desc1); in HWTEST_F_L0()
947 … JSObject::GetProperty(thread, JSHandle<JSTaggedValue>(obj100), key0).GetValue().GetTaggedValue(); in HWTEST_F_L0()
953 JSHandle<JSObject> nullHandle(thread, JSTaggedValue::Null()); in HWTEST_F_L0()
954 JSHandle<JSObject> obj1 = JSObject::ObjectCreate(thread, nullHandle); in HWTEST_F_L0()
955 JSHandle<JSObject> obj2 = JSObject::ObjectCreate(thread, obj1); in HWTEST_F_L0()
956 JSHandle<JSObject> obj3 = JSObject::ObjectCreate(thread, obj2); in HWTEST_F_L0()
958 JSHandle<JSTaggedValue> obj1Key(thread->GetEcmaVM()->GetFactory()->NewFromASCII("key1")); in HWTEST_F_L0()
959 JSHandle<JSTaggedValue> obj2Key(thread->GetEcmaVM()->GetFactory()->NewFromASCII("key2")); in HWTEST_F_L0()
960 JSHandle<JSTaggedValue> obj3Key(thread->GetEcmaVM()->GetFactory()->NewFromASCII("key3")); in HWTEST_F_L0()
961 JSHandle<JSTaggedValue> obj1Value(thread, JSTaggedValue(1)); in HWTEST_F_L0()
962 JSHandle<JSTaggedValue> obj2Value(thread, JSTaggedValue(2)); in HWTEST_F_L0()
963 JSHandle<JSTaggedValue> obj3Value(thread, JSTaggedValue(3)); in HWTEST_F_L0()
965 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj1), obj1Key, obj1Value); in HWTEST_F_L0()
966 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj2), obj2Key, obj2Value); in HWTEST_F_L0()
967 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj3), obj3Key, obj3Value); in HWTEST_F_L0()
968 JSHandle<JSHClass> obj3Class(thread, obj3->GetJSHClass()); in HWTEST_F_L0()
969 JSHandle<JSTaggedValue> resultMarker = JSHClass::EnableProtoChangeMarker(thread, obj3Class); in HWTEST_F_L0()
974 JSHandle<JSHClass> obj1Class(thread, obj1->GetJSHClass()); in HWTEST_F_L0()
975 JSHandle<JSHClass> obj2Class(thread, obj2->GetJSHClass()); in HWTEST_F_L0()
999 JSHandle<JSObject> nullHandle(thread, JSTaggedValue::Null()); in HWTEST_F_L0()
1000 JSHandle<JSObject> obj1 = JSObject::ObjectCreate(thread, nullHandle); in HWTEST_F_L0()
1001 JSHandle<JSObject> obj2 = JSObject::ObjectCreate(thread, obj1); in HWTEST_F_L0()
1002 JSHandle<JSObject> obj3 = JSObject::ObjectCreate(thread, obj2); in HWTEST_F_L0()
1003 JSHandle<JSObject> obj4 = JSObject::ObjectCreate(thread, obj2); in HWTEST_F_L0()
1004 JSHandle<JSObject> obj5 = JSObject::ObjectCreate(thread, obj4); in HWTEST_F_L0()
1005 JSHandle<JSObject> obj6 = JSObject::ObjectCreate(thread, obj2); in HWTEST_F_L0()
1006 JSHandle<JSObject> obj7 = JSObject::ObjectCreate(thread, obj6); in HWTEST_F_L0()
1008 JSHandle<JSTaggedValue> obj1Key(thread->GetEcmaVM()->GetFactory()->NewFromASCII("key1")); in HWTEST_F_L0()
1009 JSHandle<JSTaggedValue> obj2Key(thread->GetEcmaVM()->GetFactory()->NewFromASCII("key2")); in HWTEST_F_L0()
1010 JSHandle<JSTaggedValue> obj3Key(thread->GetEcmaVM()->GetFactory()->NewFromASCII("key3")); in HWTEST_F_L0()
1011 JSHandle<JSTaggedValue> obj4Key(thread->GetEcmaVM()->GetFactory()->NewFromASCII("key4")); in HWTEST_F_L0()
1012 JSHandle<JSTaggedValue> obj5Key(thread->GetEcmaVM()->GetFactory()->NewFromASCII("key5")); in HWTEST_F_L0()
1013 JSHandle<JSTaggedValue> obj6Key(thread->GetEcmaVM()->GetFactory()->NewFromASCII("key6")); in HWTEST_F_L0()
1014 JSHandle<JSTaggedValue> obj7Key(thread->GetEcmaVM()->GetFactory()->NewFromASCII("key7")); in HWTEST_F_L0()
1016 JSHandle<JSTaggedValue> obj1Value(thread, JSTaggedValue(1)); in HWTEST_F_L0()
1017 JSHandle<JSTaggedValue> obj2Value(thread, JSTaggedValue(2)); in HWTEST_F_L0()
1018 JSHandle<JSTaggedValue> obj3Value(thread, JSTaggedValue(3)); in HWTEST_F_L0()
1019 JSHandle<JSTaggedValue> obj4Value(thread, JSTaggedValue(4)); in HWTEST_F_L0()
1020 JSHandle<JSTaggedValue> obj5Value(thread, JSTaggedValue(5)); in HWTEST_F_L0()
1021 JSHandle<JSTaggedValue> obj6Value(thread, JSTaggedValue(6)); in HWTEST_F_L0()
1022 JSHandle<JSTaggedValue> obj7Value(thread, JSTaggedValue(7)); in HWTEST_F_L0()
1024 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj1), obj1Key, obj1Value); in HWTEST_F_L0()
1025 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj2), obj2Key, obj2Value); in HWTEST_F_L0()
1026 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj3), obj3Key, obj3Value); in HWTEST_F_L0()
1027 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj4), obj4Key, obj4Value); in HWTEST_F_L0()
1028 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj5), obj5Key, obj5Value); in HWTEST_F_L0()
1029 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj6), obj6Key, obj6Value); in HWTEST_F_L0()
1030 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj7), obj7Key, obj7Value); in HWTEST_F_L0()
1032 JSHandle<JSHClass> obj1Class(thread, obj1->GetJSHClass()); in HWTEST_F_L0()
1033 JSHandle<JSHClass> obj2Class(thread, obj2->GetJSHClass()); in HWTEST_F_L0()
1034 JSHandle<JSHClass> obj3Class(thread, obj3->GetJSHClass()); in HWTEST_F_L0()
1035 JSHandle<JSHClass> obj4Class(thread, obj4->GetJSHClass()); in HWTEST_F_L0()
1036 JSHandle<JSHClass> obj5Class(thread, obj5->GetJSHClass()); in HWTEST_F_L0()
1037 JSHandle<JSHClass> obj6Class(thread, obj6->GetJSHClass()); in HWTEST_F_L0()
1038 JSHandle<JSHClass> obj7Class(thread, obj7->GetJSHClass()); in HWTEST_F_L0()
1040 JSHandle<JSTaggedValue> result3Marker = JSHClass::EnableProtoChangeMarker(thread, obj3Class); in HWTEST_F_L0()
1041 JSHandle<JSTaggedValue> result5Marker = JSHClass::EnableProtoChangeMarker(thread, obj5Class); in HWTEST_F_L0()
1050 JSHandle<JSTaggedValue> result7Marker = JSHClass::EnableProtoChangeMarker(thread, obj7Class); in HWTEST_F_L0()
1058 JSHandle<ChangeListener> listeners1(thread, listeners1Value.GetTaggedObject()); in HWTEST_F_L0()
1066 JSHandle<ChangeListener> listeners2(thread, listeners2Value.GetTaggedObject()); in HWTEST_F_L0()
1082 JSHandle<JSObject> nullHandle(thread, JSTaggedValue::Null()); in HWTEST_F_L0()
1083 JSHandle<JSObject> obj1 = JSObject::ObjectCreate(thread, nullHandle); in HWTEST_F_L0()
1084 JSHandle<JSObject> obj2 = JSObject::ObjectCreate(thread, obj1); in HWTEST_F_L0()
1085 JSHandle<JSObject> obj3 = JSObject::ObjectCreate(thread, obj2); in HWTEST_F_L0()
1086 JSHandle<JSObject> obj4 = JSObject::ObjectCreate(thread, obj2); in HWTEST_F_L0()
1087 JSHandle<JSObject> obj5 = JSObject::ObjectCreate(thread, obj4); in HWTEST_F_L0()
1088 JSHandle<JSObject> obj6 = JSObject::ObjectCreate(thread, obj2); in HWTEST_F_L0()
1089 JSHandle<JSObject> obj7 = JSObject::ObjectCreate(thread, obj6); in HWTEST_F_L0()
1091 JSHandle<JSTaggedValue> obj1Key(thread->GetEcmaVM()->GetFactory()->NewFromASCII("key1")); in HWTEST_F_L0()
1092 JSHandle<JSTaggedValue> obj2Key(thread->GetEcmaVM()->GetFactory()->NewFromASCII("key2")); in HWTEST_F_L0()
1093 JSHandle<JSTaggedValue> obj3Key(thread->GetEcmaVM()->GetFactory()->NewFromASCII("key3")); in HWTEST_F_L0()
1094 JSHandle<JSTaggedValue> obj4Key(thread->GetEcmaVM()->GetFactory()->NewFromASCII("key4")); in HWTEST_F_L0()
1095 JSHandle<JSTaggedValue> obj5Key(thread->GetEcmaVM()->GetFactory()->NewFromASCII("key5")); in HWTEST_F_L0()
1096 JSHandle<JSTaggedValue> obj6Key(thread->GetEcmaVM()->GetFactory()->NewFromASCII("key6")); in HWTEST_F_L0()
1097 JSHandle<JSTaggedValue> obj7Key(thread->GetEcmaVM()->GetFactory()->NewFromASCII("key7")); in HWTEST_F_L0()
1099 JSHandle<JSTaggedValue> obj1Value(thread, JSTaggedValue(1)); in HWTEST_F_L0()
1100 JSHandle<JSTaggedValue> obj2Value(thread, JSTaggedValue(2)); in HWTEST_F_L0()
1101 JSHandle<JSTaggedValue> obj3Value(thread, JSTaggedValue(3)); in HWTEST_F_L0()
1102 JSHandle<JSTaggedValue> obj4Value(thread, JSTaggedValue(4)); in HWTEST_F_L0()
1103 JSHandle<JSTaggedValue> obj5Value(thread, JSTaggedValue(5)); in HWTEST_F_L0()
1104 JSHandle<JSTaggedValue> obj6Value(thread, JSTaggedValue(6)); in HWTEST_F_L0()
1105 JSHandle<JSTaggedValue> obj7Value(thread, JSTaggedValue(7)); in HWTEST_F_L0()
1107 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj1), obj1Key, obj1Value); in HWTEST_F_L0()
1108 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj2), obj2Key, obj2Value); in HWTEST_F_L0()
1109 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj3), obj3Key, obj3Value); in HWTEST_F_L0()
1110 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj4), obj4Key, obj4Value); in HWTEST_F_L0()
1111 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj5), obj5Key, obj5Value); in HWTEST_F_L0()
1112 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj6), obj6Key, obj6Value); in HWTEST_F_L0()
1113 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj7), obj7Key, obj7Value); in HWTEST_F_L0()
1115 JSHandle<JSHClass> obj1Class(thread, obj1->GetJSHClass()); in HWTEST_F_L0()
1116 JSHandle<JSHClass> obj2Class(thread, obj2->GetJSHClass()); in HWTEST_F_L0()
1117 JSHandle<JSHClass> obj3Class(thread, obj3->GetJSHClass()); in HWTEST_F_L0()
1118 JSHandle<JSHClass> obj4Class(thread, obj4->GetJSHClass()); in HWTEST_F_L0()
1119 JSHandle<JSHClass> obj5Class(thread, obj5->GetJSHClass()); in HWTEST_F_L0()
1120 JSHandle<JSHClass> obj6Class(thread, obj6->GetJSHClass()); in HWTEST_F_L0()
1121 JSHandle<JSHClass> obj7Class(thread, obj7->GetJSHClass()); in HWTEST_F_L0()
1123 JSHClass::EnableProtoChangeMarker(thread, obj3Class); in HWTEST_F_L0()
1124 JSHClass::EnableProtoChangeMarker(thread, obj7Class); in HWTEST_F_L0()
1125 JSHClass::EnableProtoChangeMarker(thread, obj5Class); in HWTEST_F_L0()
1127 JSHClass::NoticeThroughChain(thread, obj2Class); in HWTEST_F_L0()
1128 JSHClass::UnregisterOnProtoChain(thread, obj2Class); in HWTEST_F_L0()
1133 JSHandle<ChangeListener> listeners1(thread, listeners1Value.GetTaggedObject()); in HWTEST_F_L0()
1157 JSHandle<JSObject> nullHandle(thread, JSTaggedValue::Null()); in HWTEST_F_L0()
1158 JSHandle<JSObject> obj1 = JSObject::ObjectCreate(thread, nullHandle); in HWTEST_F_L0()
1159 JSHandle<JSObject> obj2 = JSObject::ObjectCreate(thread, obj1); in HWTEST_F_L0()
1160 JSHandle<JSObject> obj3 = JSObject::ObjectCreate(thread, obj1); in HWTEST_F_L0()
1161 JSHandle<JSObject> obj4 = JSObject::ObjectCreate(thread, obj2); in HWTEST_F_L0()
1162 JSHandle<JSObject> obj5 = JSObject::ObjectCreate(thread, obj4); in HWTEST_F_L0()
1163 JSHandle<JSObject> obj6 = JSObject::ObjectCreate(thread, obj2); in HWTEST_F_L0()
1164 JSHandle<JSObject> obj7 = JSObject::ObjectCreate(thread, obj6); in HWTEST_F_L0()
1166 JSHandle<JSTaggedValue> obj1Key(thread->GetEcmaVM()->GetFactory()->NewFromASCII("key1")); in HWTEST_F_L0()
1167 JSHandle<JSTaggedValue> obj2Key(thread->GetEcmaVM()->GetFactory()->NewFromASCII("key2")); in HWTEST_F_L0()
1168 JSHandle<JSTaggedValue> obj3Key(thread->GetEcmaVM()->GetFactory()->NewFromASCII("key3")); in HWTEST_F_L0()
1169 JSHandle<JSTaggedValue> obj4Key(thread->GetEcmaVM()->GetFactory()->NewFromASCII("key4")); in HWTEST_F_L0()
1170 JSHandle<JSTaggedValue> obj5Key(thread->GetEcmaVM()->GetFactory()->NewFromASCII("key5")); in HWTEST_F_L0()
1171 JSHandle<JSTaggedValue> obj6Key(thread->GetEcmaVM()->GetFactory()->NewFromASCII("key6")); in HWTEST_F_L0()
1172 JSHandle<JSTaggedValue> obj7Key(thread->GetEcmaVM()->GetFactory()->NewFromASCII("key7")); in HWTEST_F_L0()
1174 JSHandle<JSTaggedValue> obj1Value(thread, JSTaggedValue(1)); in HWTEST_F_L0()
1175 JSHandle<JSTaggedValue> obj2Value(thread, JSTaggedValue(2)); in HWTEST_F_L0()
1176 JSHandle<JSTaggedValue> obj3Value(thread, JSTaggedValue(3)); in HWTEST_F_L0()
1177 JSHandle<JSTaggedValue> obj4Value(thread, JSTaggedValue(4)); in HWTEST_F_L0()
1178 JSHandle<JSTaggedValue> obj5Value(thread, JSTaggedValue(5)); in HWTEST_F_L0()
1179 JSHandle<JSTaggedValue> obj6Value(thread, JSTaggedValue(6)); in HWTEST_F_L0()
1180 JSHandle<JSTaggedValue> obj7Value(thread, JSTaggedValue(7)); in HWTEST_F_L0()
1182 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj1), obj1Key, obj1Value); in HWTEST_F_L0()
1183 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj2), obj2Key, obj2Value); in HWTEST_F_L0()
1184 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj3), obj3Key, obj3Value); in HWTEST_F_L0()
1185 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj4), obj4Key, obj4Value); in HWTEST_F_L0()
1186 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj5), obj5Key, obj5Value); in HWTEST_F_L0()
1187 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj6), obj6Key, obj6Value); in HWTEST_F_L0()
1188 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(obj7), obj7Key, obj7Value); in HWTEST_F_L0()
1190 JSHandle<JSHClass> obj5Class(thread, obj5->GetJSHClass()); in HWTEST_F_L0()
1191 JSHandle<JSHClass> obj7Class(thread, obj7->GetJSHClass()); in HWTEST_F_L0()
1193 JSHClass::EnableProtoChangeMarker(thread, obj7Class); in HWTEST_F_L0()
1194 JSHClass::EnableProtoChangeMarker(thread, obj5Class); in HWTEST_F_L0()
1196 JSObject::SetPrototype(thread, obj2, JSHandle<JSTaggedValue>(obj3)); in HWTEST_F_L0()
1198 JSHandle<JSHClass> obj1Class(thread, obj1->GetJSHClass()); in HWTEST_F_L0()
1199 JSHandle<JSHClass> obj2Class(thread, obj2->GetJSHClass()); in HWTEST_F_L0()
1200 JSHandle<JSHClass> obj3Class(thread, obj3->GetJSHClass()); in HWTEST_F_L0()
1201 JSHandle<JSHClass> obj4Class(thread, obj4->GetJSHClass()); in HWTEST_F_L0()
1202 JSHandle<JSHClass> obj6Class(thread, obj6->GetJSHClass()); in HWTEST_F_L0()
1250 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in HWTEST_F_L0()
1251 JSHandle<JSTaggedValue> objFunc(thread, JSObjectTestCreate(thread)); in HWTEST_F_L0()
1253 ECMAObject::SetHash(thread, 87, JSHandle<ECMAObject>::Cast(obj)); in HWTEST_F_L0()
1256 ECMAObject::SetNativePointerFieldCount(thread, obj, 1); in HWTEST_F_L0()
1258 ECMAObject::SetNativePointerField(thread, obj, 0, array, nullptr, nullptr); in HWTEST_F_L0()
1265 static JSHandle<JSHClass> CreateTestHClass(JSThread *thread) in CreateTestHClass() argument
1267 JSHandle<GlobalEnv> globalEnv = thread->GetEcmaVM()->GetGlobalEnv(); in CreateTestHClass()
1268 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in CreateTestHClass()
1276 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in HWTEST_F_L0()
1277 EcmaVM *vm = thread->GetEcmaVM(); in HWTEST_F_L0()
1281 JSHandle<JSHClass> hc0 = CreateTestHClass(thread); in HWTEST_F_L0()
1282 JSMutableHandle<JSHClass> hca(thread, JSTaggedValue::Undefined()); in HWTEST_F_L0()
1283 JSMutableHandle<JSHClass> hcb(thread, JSTaggedValue::Undefined()); in HWTEST_F_L0()
1293 [[maybe_unused]] EcmaHandleScope handleScope(thread); in HWTEST_F_L0()
1298 … JSObject::SetProperty(thread, obj1, keyA, JSHandle<JSTaggedValue>(thread, JSTaggedValue(1))); in HWTEST_F_L0()
1299 … JSObject::SetProperty(thread, obj2, keyB, JSHandle<JSTaggedValue>(thread, JSTaggedValue(2))); in HWTEST_F_L0()
1312 … JSObject::SetProperty(thread, obj1, keyB, JSHandle<JSTaggedValue>(thread, JSTaggedValue(3))); in HWTEST_F_L0()
1313 … JSObject::SetProperty(thread, obj2, keyA, JSHandle<JSTaggedValue>(thread, JSTaggedValue(4))); in HWTEST_F_L0()
1330 JSObject::SetProperty(thread, obj3, keyA, JSHandle<JSTaggedValue>(thread, JSTaggedValue(5))); in HWTEST_F_L0()
1331 JSObject::SetProperty(thread, obj4, keyB, JSHandle<JSTaggedValue>(thread, JSTaggedValue(6))); in HWTEST_F_L0()
1344 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in HWTEST_F_L0()
1348 JSHandle<JSTaggedValue> value1(thread, JSTaggedValue(1)); in HWTEST_F_L0()
1353 … JSHandle<EcmaString>(thread, EcmaStringAccessor::Concat(thread->GetEcmaVM(), key1, key2)); in HWTEST_F_L0()
1354 properties->Set(thread, 2 * i, key3.GetTaggedValue()); in HWTEST_F_L0()
1355 properties->Set(thread, 2 * i + 1, value1.GetTaggedValue()); in HWTEST_F_L0()
1358 JSHandle<JSObject> newObj = JSObject::CreateObjectFromProperties(thread, properties); in HWTEST_F_L0()
1359 Heap *heap = const_cast<Heap *>(thread->GetEcmaVM()->GetHeap()); in HWTEST_F_L0()
1363 sHeap->WaitGCFinished(thread); in HWTEST_F_L0()
1364 SuspendAllScope suspendScope(thread); in HWTEST_F_L0()